2015-11-18 67 views
1

我試圖使用WSO2 ESB的JIRA的連接器和我不知道如何使用updateIssue模塊,不管我放在issueFields財產我總是獲得WSO2 ESB - 吉拉連接器 - updateIssue

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

當我部署它並執行時發生異常。可悲的是,沒有關於如何在文檔中使用該模塊的詳細示例。提前致謝。

WSO2 Developer Studio

回答

0

這是怎麼更新在ESB工作Connector.So檢查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參數,而不是,這相當於使用update參數設置。有關使用fields參數的示例,請參閱創建問題。

您可以設置顯式字段值或使用操作來更改字段值。可以使用/ rest/api/2/issue/{issueIdOrKey}/editmeta資源來確定fields參數或update參數中可更新的字段。如果某個字段未配置爲出現在編輯屏幕上,則該字段將不在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