【问题标题】:WSO2 ESB - Jira Connector - updateIssueWSO2 ESB - Jira 连接器 - updateIssue
【发布时间】:2016-04-25 17:15:02
【问题描述】:

我正在尝试在 WSO2 ESB 中使用 JIRA 连接器,但我不知道如何使用 updateIssue 模块,无论我在 issueFields 中放了什么属性我总是得到 ​​p>

org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException: DOCTYPE is not allowed

部署并执行时出现异常。遗憾的是,文档中没有关于如何使用此模块的详细示例。提前致谢。

【问题讨论】:

    标签: wso2 jira esb connector


    【解决方案1】:

    这就是在 ESB 连接器中更新问题的方式。所以检查 issueIdOrKey 是否正确并检查 issueFields 的格式,它也将是 JSON 字符串。

    <jira.updateIssue>
         <issueIdOrKey>ESBJAVA-2095</issueIdOrKey>
         <issueFields>{$ctx:issueFields}</issueFields>
    </jira.updateIssue>
    

    要更新问题,请使用 jira.updateIssue,指定问题 ID,并将问题的 JSON 表示作为负载附加到请求中。您使用与创建问题时类似的方法,但是当您做的不仅仅是设置新字段时,请使用更新参数而不是字段。例如,如果您想更改描述并添加和删除标签,您可以使用更新参数,如下所示:

    {
        "update": {
            "description": [
                {
                    "set": "We need to update the license agreement file before shipping the 2.0 release. Please get from John Smith in the legal department."
                }
            ],
            "labels": [
                {
                    "add": "triaged"
                },
                {
                    "remove": "blocker"
                }
            ]
        }
    }
    

    如果只需要设置字段的值,可以使用fields参数代替,相当于使用set和update参数。有关使用 fields 参数的示例,请参阅创建问题。

    您可以设置显式字段值或使用操作来更改字段值。可以在 fields 参数或 update 参数中更新的字段可以使用 /rest/api/2/issue/{issueIdOrKey}/editmeta 资源来确定。如果某个字段没有配置为出现在编辑屏幕上,它就不会出现在editmeta中,如果提交了就会出现字段验证错误。 属性

    issueIdOrKey: Identifies the issue to update. This can be an issue ID, or an issue key. If the issue cannot be found via an exact match, JIRA will also look for the issue in a case-insensitive way, or by looking to see if the issue was moved.
    

    相关的 JIRA API

    https://developer.atlassian.com/static/rest/jira/6.1.html#d2e1209

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-10-23
      • 1970-01-01
      • 1970-01-01
      • 2015-04-28
      • 2013-05-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多