Jira Automation Rule to stop transition based on Pull Request

jh074626 November 20, 2024

Ok, I'm hoping my questions are getting better.

Any ideas would be much appreciated.

I've been developing my rule to do one of two things; either move the ticket to On Hold IF there is a STAT CSR Listed AND there is no Approved BitBucket Pull Request, or create a sub task to ensure the STAT CSR is ready for CAB.

So, here's the layout:

WHEN Issued Transitioned from: "Pre-Prod Testing" or "Team Approved"
to: "Release Candidate"

- IF CSR Number is not empty

  - IF matches {{pullRequest.state}} = Approved
    Create Sub Task

  - ELSE
    Transition to ON HOLD
    Send Email

So, I know that the Pull Request Smart Value is not available unless the Trigger is a PR Trigger.  I also know that the Valid Values for {{pullRequest.state}} are Open, Declined and Merged.

I've also played around with the On Hold Notification to try and pull useful values to no avail.  This is what I have for the notification right now:

Subject:
Issue {{issue.key}} / {{issue.customfield_10034}}- Immediate Review Required! Pull Request not APPROVED:

Content:
Immediate Review Required! Pull Request not APPROVED:
{{issue.fields.summary}} - {{issue.fields.updated}}
{{project.key}} - {{project.name}}

{{pullRequest.state}} - {{pullRequest.title}} - {{pullRequest.url}}

{{issue.Development}}

1 answer

0 votes
Bill Sheboy
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.
November 23, 2024

Hi @jh074626 

There is an open suggestion to add a trigger for PR Approved, which you may watch / vote for to see progress: https://jira.atlassian.com/browse/JRACLOUD-81389

For pipeline scenarios where the automation rule triggers / actions do not provide help, you could try using the Send Web Request action to call the REST API endpoints for your source control tool. 

Here is a how-to article for calling a REST API from an automation rule: https://community.atlassian.com/t5/Jira-articles/Automation-for-Jira-Send-web-request-using-Jira-REST-API/ba-p/1443828

Kind regards,
Bill

jh074626 December 2, 2024

Thanks, Bill

Wish we were using pipelines.  I think we could avoid a number of issues if we were.  Still, an API call may well be the way.

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events