Jira It is based on Java Architecture management system (Atlassian The company supports ), There's open source code , Convenient for secondary development ( Extensibility ).Jira Is a very powerful management tool , Widely used for Defect tracking 、 Use case management 、 Demand collection 、 Task tracking 、 Time management 、 Project plan management, etc .
python Supported operations Jira Third party package for , It is convenient to customize some automatic operations .
Need to install jira library :
pip install jira
Jira authentication
from jira import JIRA
options = {'server': 'https://jira.xxxx.com'}
jira = JIRA(basic_auth=("username", "password"),options=options)
This clear text account password is not secure , So you can use another one API token The way to authenticate .
To https://id.atlassian.com/manage/api-tokens Make your API token.
from jira import JIRA
options = {'server': 'https://jira.xxxx.com'}
jira = JIRA(basic_auth=("username", YOUR_API_TOKEN),options=options)
Officials have a safer way , so Basic auth for REST APIs
The following is an introduction of my experience in the project python Yes jira Control of
[JIRA] url = https://acsjira.XXX.com/ user = account pass = password [DEFECT] project_key = jira project key project_id = project id project_name = project name issue_type_name = Defect [else] label = CyberSecurity planned_iteration = SAST ; standard version ;product/s = 74952 products = Cyber Security
2、db.py Operate local database , preservation jira Newly reported defect Status to local , And other reported , Not reported , Closed, etc defect Information
3、export.csv Export the newly reported defect To local csv file , And send an email to the relevant person to remind
4、jira_operation.py Yes jira Basic operation , Including automatic escalation defect, Inquire about defect state ,reopen defects , Automatically resolve, Automatically close defects , Return the current defect status and record, etc
5、utils.py python operation csv file , Reading and writing , Save, etc
6.main.py The main function , Receive from jenkins Post build steps ,post build task Script parameters of plug-in configuration , Judge whether it has been reported defect, If you don't report it , Save as csv, Close defects, etc
7.pipfile Use python edition ,jira Version of the configuration