How to get the Jira issues for a specific build

For several Reports, i have to fetch the Jira issues for a specific build via CLI.

Currently i use:

java -jar lib/bamboo-cli-3.9.0.jar --server https://xxxxx.xx --user xxxxxx --password xxxxx --action getBuild --build "EBA-TESTING-129"

and Receiving the info:

jiraIssues:
max-result . . . . . . . : 2
size . . . . . . . . . . : 2
start-index . . . . . . . : 0

But i need as output only the list of Jira issues which are in this build. I can't use in this script the rest api via https i need to use the atlassian CLI tool.

Do you have any idea for this?
Best Regards

Joerg

2 answers

1 accepted

This widget could not be displayed.

Hi,

 

thanks for your answer. In the meantime i found the solution and also a solution for a transition change.

Run this in Bamboo as Job in the last build step.

#!/bin/bash
JAVA_HOME=<your java dir>
JAVA=$JAVA_HOME/bin/java
CLI=<atlassian cli directory>
USER="<userid>"
PASSWORD="<password>"
BAMBOOSERVER="<bamboo url>"
JIRASERVER="<JIRA url>"
TRANSITION="false"
TRANSITIONSTEP="deploy prod"
cd $CLI
TicketList=` \
$JAVA -jar lib/bamboo-cli-3.9.0.jar \
--quiet \
--server $BAMBOOSERVER \
--user $USER \
--password $PASSWORD \
--action getBuild \
--build "${bamboo_planKey}-${bamboo_buildNumber}" \
--expand jiraIssues | \
grep key | grep -E -o "<regexp for your issue keys>"`
echo "Jira issue list:"
echo $TicketList
echo " "
for i in $TicketList
do
$JAVA -jar lib/jira-cli-3.9.0.jar \
--quiet \
--server $JIRASERVER \
--user $USER \
--password $PASSWORD \
--action progressIssue \
--issue $i \
--step "$TRANSITIONSTEP"
done
# A failed transition should never abort the build
exit 0

 

 

This widget could not be displayed.

Hello Joerg,

Thank you for your question.

You could run the same command and append '–expand "jiraIssues"' to it. As a result, you would have:

java -jar bamboo-cli-3.9.0.jar --server http(s)://<bamboo-base-url> --user <bamboo-username> --password <bamboo-password> --action getBuild --build "EBA-TESTING-129" --expand "jiraIssues"

If you find this answer useful, I would kindly ask you to accept it so the same will be visible to others who might be facing the same issue you have inquired.

Thank you for your understanding.

Kind regards,
Rafael P. Sperafico
Atlassian Support

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted 12 hours ago in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

39 views 1 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you