gpt4 book ai didi

python - 如何使用 jira-python 设置 fixVersions 字段

转载 作者:行者123 更新时间:2023-11-28 22:57:44 25 4
gpt4 key购买 nike

我正在尝试使用 jira-python 模块 (http://jira-python.readthedocs.org/en/latest/) 更新现有的 JIRA。具体来说,我正在尝试设置问题的 fixesVersion 列表。我已经尝试了一段时间但没有运气。我错过了什么?

issue = jira.issue('DUC-391')
issue_dict = { 'fixVersions' : [{'id': '10115'}] }
issue.update(fields=issue_dict)

返回的堆栈跟踪:

Traceback (most recent call last):
File "post-commit-jira.py", line 35, in <module>
issue.update(fields=issue_dict)
File "/Library/Python/2.6/site-packages/jira/resources.py", line 193, in update
super(Issue, self).update(**data)
File "/Library/Python/2.6/site-packages/jira/resources.py", line 72, in update
raise_on_error(r)
File "/Library/Python/2.6/site-packages/jira/exceptions.py", line 29, in raise_on_error
error = errorMessages[0]

最佳答案

查看 https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+Edit+issues 中组件的添加、设置和删除示例您可以使用名称而不是有用的 id,例如

issue_dict = { 'fixVersions' : [{'add': {'name': 'Name of the version 10115'}}] }

关于python - 如何使用 jira-python 设置 fixVersions 字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14495448/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com