我想检查发送请求后是否可以返回问题ID。
下面是我的代码
issue_dict = {
'project': {'id': 123},
'summary': 'New issue from jira-python',
'description': 'Look into this one',
'issuetype': {'name': 'Bug'},
}
new_issue = jira.create_issue(fields=issue_dict)
有没有办法,我可以在这里检索问题ID,还是需要设置另一个查询?
谢谢
答案 0 :(得分:2)
根据documentation create_issue
将返回一个Issue
,其中包含ID和发布密钥。
issue_dict = {
'project': {'id': 123},
'summary': 'New issue from jira-python',
'description': 'Look into this one',
'issuetype': {'name': 'Bug'},
}
new_issue = jira.create_issue(fields=issue_dict)
print(new_issue.id)
print(new_issue.key)