Instantly share code, notes, and snippets.

Embed
What would you like to do?
This one is to get current Jira sprint number
#!/bin/bash
# This one is to be executed once to figure out rapidBoardId
#curl -u kagarlickij:Password -X GET -H "Content-Type: application/json" 'https://kagarlickij.atlassian.net/rest/greenhopper/1.0/rapidviews/list'
curl -u kagarlickij:Password -X GET -H "Content-Type: application/json" \
'https://taqneen.kagarlickij.net/rest/greenhopper/1.0/sprintquery/17?includeFutureSprints=true&includeHistoricSprints=false' \
| /usr/local/bin/jq '.sprints[] | select(.name | contains("PAC")) | select(.state == "ACTIVE") | .name' | sed 's/[^0-9]*//g' > currentSprint.txt
echo "Current Sprint number in Jira is $(cat currentSprint.txt)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment