我正在使用 JIRA Python REST API 在 JIRA 中创建问题,但我不知道如何设置问题的创建日期和更新日期字段,以及如何将日期格式化为 JIRA 想要的格式。我的代码如下:
jira.create_issue(project={'key': 'DEL'},
created='10/4/2012 9:30:00 AM',
updated='12/22/2012 10:00:00 AM',
priority={'name': 'Critical'},
summary='My summary',
description='My description',
issuetype={'name': 'Bug'})
它给了我一个恼人的错误,即使它们存在,它甚至无法识别这些字段(引用:http://jira-python.readthedocs.org/en/latest/index.html):
JIRAError: HTTP 400: "{u'updated': u"Field 'updated' cannot be set. It is not on the appropriate screen, or unknown.", u'created': u"Field 'created' cannot be set. It is not on the appropriate screen, or unknown."}"
最佳答案
在我的 Jira v.5.2.1 中,这些字段不可编辑。我认为您无法更改这些字段,因为它们被服务器“加了时间戳”并且无法编辑。此外,Atlassian 在其 REST API 中并未提及这些字段。文档。
如果您确实需要更新这些字段,您可以直接在其连接的数据库中更新。
此外,针对此类问题的有用论坛是 answers.atlassian.com
PS。这可能应该是评论而不是答案,但我的声誉还没有 50。关于python - 如何使用 Python REST API 在 JIRA 中设置创建日期和更新日期字段?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17932711/