2012-06-03 76 views
1

每當我試圖發送一個問題吉拉一次,我發現了以下錯誤創建問題時:泡沫錯誤吉拉

suds.WebFault: Server raised fault: 'org.xml.sax.SAXException: 
    Found character data inside an array element while deserializing' 

我計算器上的搜索和網頁的答案,有些人說是泡沫0.3 <故障。但是我使用的是0.4.1.1版本。

這裏是我的問題字典:

issue = {"assignee": "user_test", 
      "components": "17311", 
      "project": "TES", 
      "description" : "This is a test", 
      "priority" : "Major", 
      "summary" : "Just a test title", 
      "type":"Incident" 
      } 

類吉拉我做的:

def create_issue(self,issue): 
     if(not isinstance(issue,dict)): 
      raise Exception("Issue must be a dict") 

     new_issue = self.jira.service.createIssue(in0 = self.auth,in1 = issue) 

     return new_issue["key"] 
+0

不應該問題對象而不是字典? 'self.jira.factory.create('Issue')' – jordanm

回答

1

使用JIRA,蟒蛇,我能夠與像添加組件:

jira.create_issue(project={'key': project_id}, summary=ticket_summary, 
           description=ticket_description, issuetype={'name': ticket_issue_type}, 
           components=[{'name': 'Application Slow'},], parent={'id': new_issue_key}, customfield_10101=termination_change_date, 
           ) 

我一直試圖發送一個組件作爲「components = {'name':'Application Slow'}」,但我得到了「數據不是數組」(或類似的東西)。我看了一下REST API以及他們的一些數組示例是如何構成的,這就是我如何使用上面的示例。

https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+Create+Issue#JIRARESTAPIExample-CreateIssue-Request

Labels 
"customfield_10006": ["examplelabelnumber1", "examplelabelnumber2"] 
Labels are arrays of strings 

我知道這是一個有點題外話,但是當我搜索我的問題,我發現自己回到這裏經常,所以我希望這是你的情況和其他人有點幫助的。這個概念與組件字段只會接受一組對象相同。