Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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,551,765
Community Members
 
Community Events
184
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_Atlassian Certified Master_ 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 !!!

0 votes
Muhammad Ramzan_Atlassian Certified Master_
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.
Jun 09, 2020 • edited

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.

Muhammad Ramzan_Atlassian Certified Master_
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.
Jun 09, 2020 • edited

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?

Muhammad Ramzan_Atlassian Certified Master_
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.
Jun 09, 2020

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
Muhammad Ramzan_Atlassian Certified Master_
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.
Dec 23, 2020 • edited

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
Muhammad Ramzan_Atlassian Certified Master_
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.
Feb 07, 2021

@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 # people like 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
AUG Leaders

Atlassian Community Events