我需要使用 Python 更新 JIRA 中的自定义字段。我检查了其他答案,它们只提供文本字段的解决方案。但我有一个多值列表,我想使用 Python 更新它。
我尝试过这个,但它不起作用。
issue.update(fields={'customfield_13090': {'value':'64'}})
Run Code Online (Sandbox Code Playgroud)
当我运行该行时出现此错误
jira.exceptions.JIRAError: JiraError HTTP 400 url: https://test.jira.com/rest/api/2/issue/1400908679
text: Can not deserialize instance of java.lang.Long out of START_OBJECT token
at [Source: N/A; line: -1, column: -1]
Run Code Online (Sandbox Code Playgroud)
我检查了列表字段,发现值 64 是我需要更新的选项值(如果我希望列表将实施服务作为选定选项)。
<option selected="selected" value="64">
Implementation Services
</option>
Run Code Online (Sandbox Code Playgroud)
有人可以告诉我我的代码行中有什么错误吗?
我认为你很接近,但应该是这样的:
issue.update(fields={'customfield_13090': '64'})
Run Code Online (Sandbox Code Playgroud)
如果这不起作用,我相信替代的指定解决方案是:
issue.update(fields={'customfield_13090': [{'value':'64'}]})
Run Code Online (Sandbox Code Playgroud)
这只是基于我对配置/更新 JIRA 搜索的研究。
| 归档时间: |
|
| 查看次数: |
12449 次 |
| 最近记录: |