最近在提取JIRA issue的各种信息,有的信息无法使用python jira模块直接提取,找到了JIRA的API
因此联合使用jira和request模块来筛选数据
举个简单例子,后续记录详细用法
import requests
from requests.auth import HTTPBasicAuth
from jira import JIRA
import json
username = 'xxxxx'
password = 'xxxx'
jira = JIRA(options={'server': "https://xxxxxx.com", 'verify': False},
basic_auth=(username, password))
filter_id = '366915'
filter_ins = jira.filter(filter_id)
url = filter_ins.searchUrl
response = requests.get(url, auth=HTTPBasicAuth(username, password), verify=False)
# 不加verify=False会报认证问题
response_dict = json.loads(response.text)
print(type(response_dict))
print(response_dict["total"])