Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Trigger the build in Bamboo based on specific commit message in Jira

sangeethakannan January 3, 2020 edited

Hi Friends,

My use case is based on the "Specific commit message in Jira, build should trigger in Bamboo.

For example, creating/updating the comment like "Build the Bamboo plan" in Jira, Bamboo should trigger the build.

For other comments in Jira, it should not trigger the build.

Following are the steps taken,

    I have created the webhook in Jira, eg) comment ~ "\"Build the Bamboo plan\"".

 first time, if I give comments like "initiate build" --> Bamboo build was not triggered.

                  if I give the comments like "Build the Bamboo plan" --> build triggered

         Now,  if I give the comments like "initiate the build" --> Build is triggered (which should not happen)

Can anyone kindly help on the above scenario.

 

 

Regards,

Sangeetha K

2 answers

1 vote
Aron Gombas _Midori_
Community Champion
April 12, 2021 edited

With the combination of the Automation for Jira (A4J) and Better DevOps Automation apps you could create an automation rule for this use case:

  1. Add the trigger "Issue commented".
  2. Add the condition "Advanced compare condition" and compare the comment text to your expected string.
  3. Add the Run Groovy script action and use one of the Bamboo related Groovy scripts. You can probably find the script that can be just copied over.

This could work for any major CI/CD system:

bamboo-jenkins-teamcity-builds

Disclaimer: I am a developer working on the second app used for this answer.

0 votes
Andrej Freeze _ greenique
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 3, 2020

Hey @sangeethakannan 

you can of course create an automation like that, but I would be careful in your situation.

However, if you really are trying to achieve this, you could use Automation for Jira Pro or ScriptRunner for Jira for that purpose, depending on what you already have.

In there, listen to the Issue Updated Event and check for changes in the comments body, using a regex. Then, if that was a match, fire a webhook or execute a script that fires a webhook.

You can also create new buttons in the More Menu of your issue, this way you would have a more controlled way of executing your build.

Cheers,

Andrej from greenique

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, confluence, loom, atlassian intelligence, ai notes, ai-powered meeting notes, atlassian community events, ace, confluence ai, loom ai integration, ai note-taking, atlassian ai features, team '25, atlassian live learning, confluence automation

Unlock AI-powered meeting notes: Join our live learning session! 📹

Did you catch the news at Team ‘25? With Loom, Confluence, Atlassian Intelligence, & even Jira 👀, you won’t have to worry about taking meeting notes again… unless you want to. Join us to explore the beta & discover a new way to boost meeting productivity.

Register today!
AUG Leaders

Atlassian Community Events