Forums

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

Jira Automation Not Working: Move Issue When PR is Merged (Based on Target Branch)

naveen
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 29, 2025

Hi Team,

We are trying to set up an automation that updates the Jira issue status automatically when a GitHub Pull Request (PR) is merged.

Here’s the flow:

  • Each Jira issue key (e.g., BS-123) is included in the branch name.

  • We suffix the environment in the branch name (e.g., BS-123-something-staging, BS-123-hotfix-preproduction, etc.).

  • When a Pull Request is created and merged, Jira recognizes the linked issue through the GitHub integration.

  • We want to automate status transitions based on the target branch (i.e., where the PR is merged into).

Our goal:

  • If a PR is merged into a branch named with staging, the linked Jira issue should move to "QA: Not Integrated to Frontend".

  • If merged into pre-production, move it to "Pre-Production: Not Integrated to Frontend".

  • If merged into production, move it to "Production: Not Integrated to Frontend".

What we have implemented:

  • Trigger: Pull Request Merged

  • Condition: Smart Value Condition

    • Smart Value used: {{pullRequest.destinationBranch}}

    • Operator: Contains

    • Values tested: staging, pre-production, production

  • Structure: We used an if-else block structure, where each branch name condition is checked in a separate "if block" with transitions defined inside.

We also tried using {{pullRequest.destinationBranch.name}} instead of {{pullRequest.destinationBranch}}, but the automation still doesn't trigger the status transition correctly.

Could you please guide me on the correct smart value to use, or suggest how I should configure this?

Thanks!

1 answer

1 accepted

2 votes
Answer accepted
Marc - Devoteam
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.
April 29, 2025

Hi @naveen 

Welcome to the community.

Make a variable based on the smart value, I presume you do get a result from using the smart value?

Then use a smart value condition where you compare the variable context against the required value.

naveen
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 30, 2025

Thanks @Marc - Devoteam it's working now!

Marc - Devoteam
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.
May 1, 2025

Hi @naveen 

Please accept my answer as a solution, if my answer helped to solve your request.

This will help other community member trying to solve the same.

P.S. If the answer is very valuable to you, please share some kudos.

Like naveen likes this

Suggest an answer

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

Atlassian Community Events