It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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:

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


2 answers

1 accepted

0 votes
Answer accepted



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.

JAVA_HOME=<your java dir>
CLI=<atlassian cli directory>
BAMBOOSERVER="<bamboo url>"
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
$JAVA -jar lib/jira-cli-3.9.0.jar \
--quiet \
--server $JIRASERVER \
--user $USER \
--password $PASSWORD \
--action progressIssue \
--issue $i \
# A failed transition should never abort the build
exit 0



0 votes

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
Community showcase
Published in Bamboo

Unable to add or edit Bitbucket Cloud repository in Bamboo

On 31 May, a GDPR-related change went live in the Bitbucket Cloud API that resulted in users not being able to create or edit Bitbucket Cloud Linked repositories in Bamboo. This API update removed t...

1,406 views 2 7
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you