2012-06-03 74 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 

我知道这是一个有点题外话,但是当我搜索我的问题,我发现自己回到这里经常,所以我希望这是你的情况和其他人有点帮助的。这个概念与组件字段只会接受一组对象相同。