CLI script to retrieving data from JIRA
This script will fetch the current iteration of a given team and get the workitems to calculate the story points availabe in the columns. This can be used to know the burndown of a team in a daily basis.
You will need the update the variables in Makefile:
JIRA_TOKEN
Kindly check the document of JIRA API
Check here for more information, on how to get the above details
To generate JIRA_TOKEN Follow the link here
The arguments can be passed via the Makefile:
Calculate burn down for the Day from JIRA Scrum Board
optional arguments:
-h, --help show this help message and exit
-a TOKEN, --token TOKEN
Authorization Token to JIRA Board
============= ======= ========
.. items points
============= ======= ========
Done 4 22
Ready To Test 1 8
In Progress 1 8
Code Review 1 2
TOTAL 7 40
============= ======= ========
This script can be run via Jenkins and Post result to the slack channel, to reduce the time to check it manaually and the rest of the team can view the burndown daily. An agile team can use it as they are self-organizing team.
Create a Pipeline Project in Jenkins with the following configurations:
Since we need to pass the ID we need to create add this credentials in Jenkins si it can be passed dynamically.
This project is parameterized
- we are going to create one String Parameter
& three Credentials Parameter
.
We are using Jenkins Credentials Provider: Jenkins
to secure our Token and ID's generated from ADO.
To run Pipeline
we use Pipeline script
node('linux') {
def date = new Date()
String datePart = date.format("dd-MM-yyyy")
String timePart = date.format("HH:mm")
withCredentials([
string(credentialsId: 'JENKINS_CREDENTIALS_PROVIDER_ID_PROJECTID', variable: 'P1'),
string(credentialsId: 'JENKINS_CREDENTIALS_PROVIDER_ID_TEAMID', variable: 'P2'),
string(credentialsId: 'JENKINS_CREDENTIALS_PROVIDER_ID_ADO_TOKEN', variable: 'P3'),
]) {
git([url: 'git@github.com:ado-project-burndown-slack.git', branch: 'master'])
def getResult
stage ('Execute Script') {
getResult = sh(
script: "python daily-burn-down.py -g "+GROUPID+" -p "+'${P1}'+" -t "+'${P2}'+" -a "+'${P3}'+"",
returnStdout: true,
)
}
stage ('Send Slack Notification') {
slackSend channel: '#your-slack-channel-name', color: 'good', message: '```' +getResult+ '``` Burndown '+datePart+' '+timePart+' :white_check_mark:'
}
}
}
Please note that I haven't covered the integration of Send Slack Notification
you can check for more information here..