每次尝试向 Jira 发送问题时,我都会收到以下错误:
suds.WebFault: Server raised fault: 'org.xml.sax.SAXException:
Found character data inside an array element while deserializing'
我在 stackoverflow 和网络上搜索答案,有些人说这是 suds 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"
}
我制作的 Jira 类:
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"]
最佳答案
使用 jira-python 我可以添加类似的组件:
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 以及它们的一些数组示例是如何组成的,这就是我如何得出上面的示例。
Labels
"customfield_10006": ["examplelabelnumber1", "examplelabelnumber2"]
Labels are arrays of strings
我知道这有点偏离主题,但是当我搜索我的问题时,我发现自己经常回到这里,所以我希望这对您的案例和其他人有一点帮助。概念与 Components 字段相同,仅接受对象数组。
关于python - 为 Jira 创建问题时出现 Suds 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10871046/