【发布时间】:2022-09-25 14:28:00
【问题描述】:
我正在做一个项目,我必须更新 jira 问题字段,如组件、史诗链接等。 我正在使用 jira python 客户端(https://pypi.org/project/jira/)来完成这项任务。
ticketObj = authJira.issue(\'ABC-12345\')
print(ticketObj.fields.components)
这是输出以下结果
[]
因为 components 是一个数组 因此,如果要更新 jissue 中的字段,我必须执行以下操作
ticketObj.update(components = [\'component 1\'])
但是这种方法给出了以下错误
JiraError HTTP 400 url: https://jira.yourdomain.com/rest/api/2/issue/1234567
text: Can not instantiate value of type [simple type, class com.atlassian.jira.rest.api.issue.FieldOperation] from JSON String; no single-String constructor/factory method (through reference chain: com.atlassian.jira.rest.v2.issue.IssueUpdateBean[\"update\"])
response headers = {...}
response text = {\"errorMessages\":[\"Can not instantiate value of type [simple type, class com.atlassian.jira.rest.api.issue.FieldOperation] from JSON String; no single-String constructor/factory method (through reference chain: com.atlassian.jira.rest.v2.issue.IssueUpdateBean[\\\"update\\\"])\"]}
标签: python jira atlassian-plugin-sdk