python连接jira

2021-07-30  本文已影响0人  gz_tester
  1. 安装jira包
    pip install jira
  2. 获取jira账户权限
from jira import JIRA

jr = JIRA('http://jira.test×××.net', auth=("useranme", "password"))
  1. 调取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)
上一篇 下一篇

猜你喜欢

热点阅读