python连接jira
2021-07-30 本文已影响0人
gz_tester
- 安装jira包
pip install jira
- 获取jira账户权限
from jira import JIRA
jr = JIRA('http://jira.test×××.net', auth=("useranme", "password"))
- 调取jira接口,获取jira数据
jql = "project=test AND issuetype=Sub-task AND assignee in ('test') AND Sprint in openSprints()"
search_data = jr.search_issues(jql, maxResults=999)
data = []
for i in search_data:
res = {}
isss = jr.issue(i.id)
res['issuekey'] = i.key
res["summary"] = isss.fields.summary
data.append(res)
print(data)