gpt4 book ai didi

python jira 无法转换问题

转载 作者:太空宇宙 更新时间:2023-11-04 12:18:37 24 4
gpt4 key购买 nike

我正在使用 python jira 模块 https://jira.readthedocs.io/en/master/examples.html#transitions

def jira_comment():
options = {
'server': 'https://xxxxxxxxx.atlassian.net'}

jira = JIRA(options, basic_auth=('xxxxx', 'xxxxx'))

jira_commit = get_github_ticket("https://github.com/xyz/project-1/commit/99c8d17aa7eb33643881cd47e70c0892607e9caa")
jira_ticket = jira_commit[1].split(" ")[0].replace("#","")
issue = jira.issue(jira_ticket)

jira.add_comment(issue, 'test by KSHK #4=')

transitions = jira.transitions(issue)
for t in transitions:
print (t['id'])
print (t['name'])

jira.transition_issue(issue, '261')

def main():
jira_comment()


if __name__ == "__main__":
main()

但是它无法解决问题,用户已经拥有管理员访问权限。

输出:

Traceback (most recent call last):
File "/root/PycharmProjects/pyhunt2/github_test.py", line 75, in <module>
main()
File "/root/PycharmProjects/pyhunt2/github_test.py", line 71, in main
jira_comment()
File "/root/PycharmProjects/pyhunt2/github_test.py", line 46, in jira_comment
jira.transition_issue(issue, '261')
File "/root/PycharmProjects/pyhunt2/jira/client.py", line 108, in wrapper
result = func(*arg_list, **kwargs)
File "/root/PycharmProjects/pyhunt2/jira/client.py", line 1255, in transition_issue
url, data=json.dumps(data))
File "/root/PycharmProjects/pyhunt2/jira/resilientsession.py", line 153, in post
return self.__verb('POST', url, **kwargs)
File "/root/PycharmProjects/pyhunt2/jira/resilientsession.py", line 146, in __verb
raise_on_error(response, verb=verb, **kwargs)
File "/root/PycharmProjects/pyhunt2/jira/resilientsession.py", line 56, in raise_on_error
r.status_code, error, r.url, request=request, response=r, **kwargs)
jira.exceptions.JIRAError: JiraError HTTP 400 url: https://xxxxxxx.atlassian.net/rest/api/2/issue/SBAU-11601/transitions
text: Can't move (SBAU-11601). You might not have permission, or the issue is missing required information. If you keep having this problem, contact your Jira Administrator.

response headers = {'X-Seraph-LoginReason': 'OK', 'Connection': 'close', 'transfer-encoding': 'chunked', 'X-AUSERNAME': 'xxxxx', 'Content-Type': 'application/json;charset=UTF-8', 'Server': 'Atlassian Proxy/0.1.131', 'ATL-vTM-Backend-Time': '991', 'X-AREQUESTID': '528x869535x11', 'Strict-Transport-Security': 'max-age=315360000; includeSubDomains; preload', 'X-Content-Type-Options': 'nosniff', 'ATL-vTM-Queue-Time': '0', 'Cache-Control': 'no-cache, no-store, no-transform', 'Date': 'Wed, 11 Oct 2017 08:48:46 GMT', 'ATL-vTM-Time': '991'}
response text = {"errorMessages":["Can't move (SBAU-11601). You might not have permission, or the issue is missing required information. If you keep having this problem, contact your Jira Administrator."],"errors":{}}

最佳答案

我从你的错误日志中了解到两件事:

  1. 您实际上有权就此问题执行转换吗?只需转到您的 jira 服务器并检查您是否可以手动执行问题的转换?

  2. 根据您的 jira 工作流程,您为转换指定的“Id”是否与相同的转换 ID 相同?您必须发送 jira 转换 ID,而不是执行转换后产生的实际转换名称。

关于python jira 无法转换问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46684482/

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