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

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

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.

1 answer

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?

Muhammad Ramzan Community Leader 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?

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?

Muhammad Ramzan Community Leader 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

Suggest an answer

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

🍂📹 Apptoberfest demo contest roundup: vote for your favorite demos!

Hi Community! The submissions are in (and listed below) for the 🍻🍂Apptoberfest🍂🍻 Demo Competition and it’s time for you to place your votes for the best: Analytics & reporting app demo ...

87 views 2 11
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