Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,300,737
Community Members
 
Community Events
165
Community Groups

Is there an automation rule option for Pull Request Approved?

I want to automatically transition issues to "Awaiting Release" status, once the pull request is approved. This tells me that it will be merged soon and no one needs to do more work on it. For now, I need the reviewer to manually move it to that status.

2 answers

@Muhammad Ramzan Can we auto approve all commits automatically when workflow transition change? For example transition changed from In Review to Ready For QA then I have to approve all commits automatically on my repo in bitbucket.

Appreciate your help, Thanks in advance !!!

Create trigger on your jira workflow and then select the bibucket option , once pull request is approved this trigger will be triggered and transition will be changed.

 

https://confluence.atlassian.com/adminjiracloud/configuring-workflow-triggers-776636696.html

Thanks for the reply.

Pull request Approved is not on the list of available triggers for workflow transitions.

In addition, I want to be able to do this from the new automation rules.

My mistake i did not read about the pull request trigger.

If you have  automation for jira then you can achieve this as follow.

 

  • In jira automation create a webhook 
  • Configure that webhook inside your bitbucket repo and select the event pull request approved.
  • On jira for automation, add rules once webhook is triggered, transition he issue to your required state.

What is "jira for automation"? Is that an add-on?

If you using jira cloud by default you will have automation for jira plugin if you using server then its separate plugin provided by jira

@Muhammad 

I'm not really familiar with webhooks, so bear with me....  Here's my goal:

  1. ANY ticket connected to a project's Bitbucket repo is worked on by a developer, who submits a pull request. The ticket transitions to "Code Review" status and assigns the ticket to the technical architect. 
  2. The technical architect approves the pull request which triggers the automation rule which reassigns the ticket to the original developer and transition the ticket to "Code Approved" status.

Q1: What option do you select for the webhook? 

  1. Issues provided in the webhook HTTP POST body
  2. Issues provided by running the following JQL search
  3. No issues from the webhook

Q2: How does Jira find the associated ticket for any given pull request from the repo? Would I add a step to look up a ticket somehow or does it connect automatically? 

Q3: Do I need a JQL Condition in place with a query like this?

assignee WAS in (557058:7f4cc0f9-6748-4551-8f01-ebf780d212e7) AND assignee in (557058:b05d092f-0845-429d-b6e3-80f1442ae8b1) AND project = FSS AND status = "CODE REVIEW"

I assume that it would be best to filter the tickets so that the correct developer was assigned, but with multiple developers on this project I wonder if there is an easier way to do this all together. 

In other words: How would you configure this automation rule, exactly?

Like Arron Fletcher likes this

You can use built in triggers by jira automation , here are the guidelines 

https://www.atlassian.com/nl/software/jira/automation-template-library/bitbucket-github-gitlab

https://support.atlassian.com/jira-software-cloud/docs/smart-values-development/

 

In your commit message, jira issue key must exist then automation will know for which issue this rule will be executed.

Sorry, but pull request approvals don't exist in the built in triggers in Jira Automation, so I'm not sure what I'm looking for in the documentation. How did you configure the webhook to pull in the title/issue ID and user ID from the pull request POST body?

Like Arron Fletcher likes this

@Lissa Meade , Pull request approval trigger does not exist. To achieve this , please follow the steps as below.

You need to perform some steps on Jira & Bitbucket side.

 

  • On Jira side create automation rule and trigger should be "Incoming Webhook", copy the url
  • Now go to Bitbucket. Repo setting >Webhooks.
  • Past the url which you copied from the jira automation rule.
  • Select the Approved check box
  • Go back to Jira and add a new action on same automation , process the webhook json and then you can perform the required actions.

 

Below is the link for your guide, its not same as you trying to achieve but it will give you the flexibility to implement your automation rule.

https://blog.codebarrel.io/how-to-integrate-jira-and-github-using-automation-part-2-5eb816f2b947

2021-02-07_14-31-50.png2021-02-07_14-31-36.png

Like Nitin Bhosale likes this

Hello Muhammad,

Is there any movement on this issue? We would like to be able to implement more formal rules based on bitbucket pr approvals. If not, can you rehost the information that was on codebarrel? The link seems to have expired. Thank you.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Apps & Integrations

Marketplace Partner Spotlight: AppLiger

This month the spotlight is on AppLiger. We caught up with Pavel Pavlovsky, CEO and Product Manager, to learn how the company started and what fuels the team's creativity.    Atlassian:...

406 views 0 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