如何使用Python更新JIRA中的自定义字段值



我需要使用Python更新JIRA中的自定义字段。我检查了其他答案,它们只提供文本字段的解决方案。但是我有一个多值列表,我想使用Python更新它。

我试过了,但没用。

issue.update(fields={'customfield_13090': {'value':'64'}})

当我运行时,我遇到了这个错误

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]

我检查了列表字段,发现如果我希望列表将Implementation Services作为所选选项,则值64是需要更新的选项值。

<option selected="selected" value="64">
Implementation Services
</option>

有人能告诉我我的代码行中有什么错误吗。

我认为你很接近,但应该是这样的:

issue.update(fields={'customfield_13090': '64'})

如果这不起作用,我相信另一个指定的解决方案是:

issue.update(fields={'customfield_13090': [{'value':'64'}]})

这只是基于我对配置/更新JIRA搜索的研究。

for a given 'customfield_13090': {
'self': 'some link ',
'value': '84',
'id': '21104'
}

以下代码应工作

issue.update(fields={'customfield_13090': {'value':'64'}})

最新更新