Automatically creating a jira issue after a failed bamboo build

Hello all;

Is there a way in which i can integrate a jira project with bamboo plan. I want to create a jira issue automatically once the bamboo build fails for that plan. And also want to assign the jira ticket to the person who committed the code at the time of build failure.

thank you

3 answers

5 votes

Hello Surya,

Thank you for your question.

As @Gretchen Jones have mentioned, you are able to install Pre-Post Build Command Runner plugin and create a JIRA issue by running the following command:

# USERNAME, i.e.: admin
# PASSWORD, i.e.: nimda
# PROJECT-KEY, i.e.: BAM
 
curl -D- -X POST -u USERNAME:PASSWORD -H "Content-Type: application/json" -d '{ "fields": { "project": { "key": "PROJECT-KEY" }, "summary": "${bamboo.planName} - ${bamboo.buildNumber}", "description": "Link to the failed build:\n${bamboo.resultsUrl}", "issuetype": { "name": "Bug" }}}' https://JIRA-BASE-URL/rest/api/2/issue/

In Cloud, you can run the same command by running a Script task.

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

But currently above script is creating issue if plan is pass also. I need only bug for if above plan is failed

I think you could use the pre-post build command plugin to execute a REST command and create a jira ticket. See this plugin:

https://marketplace.atlassian.com/plugins/com.sysbliss.bamboo.plugins.prepost-build-command

Is not available the same or similar thing but for 'on Demand' or in 'Cloud'?

 

Thanks in advance!

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Posted 11 hours ago in Jira

We want to know what Jira Service Desk apps you're using!

Hi Community! My name is Amir and I’m on the Jira Service Desk product marketing team at Atlassian. Our team would love to understand how you’re leveraging our ecosystem for Jira Service Desk. Wha...

34 views 0 5
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