Forums

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

How Distinguish Pull Requests by 'to branch' in Github Integration

이희찬
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!
July 5, 2022

Hello, our team wants to integrate JIRA and github and start to use automation.

 

Our repository has the following git flow strategy.

If we make new issue named 'TEAM-1', these 3 branch exist.

- dev

- QA

- TEAM-1/blahblah

 

Before deployment, we merge 'TEAM-1' branch to 'QA' branch by Pull Requests. After tests ends, 'TEAM-1' branch is merged to 'dev' branch.

 

When TEAM-1 -> QA PR merging, I want to set state of JIRA from 'In Progress' to 'Reviewing'. TEAM-1 -> dev mergeing, I want to set state JIRA from 'Reviewing' to 'Done'.

 

However, I can't find a way to distinguish PR by where branch they will merged in.

Can't automation rules be applied depending on the what branch they will be merged in? Thanks.

1 answer

1 accepted

3 votes
Answer accepted
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 7, 2022

Hi,

If you were using the workflow triggers alone in Jira, I don't think their will be a way to distinguish between the branches.  However if you use Automation within Jira, then you can actually use a smart value to do this.  Check out {{pullRequest.destinationBranch}} the documentation in that link explains that you can use the smart value of {{pullRequest.destinationBranch}} to return the name of the branch you are merging into.

In that case, you could then setup an automation rule like this one:

Screen Shot 2022-07-07 at 3.02.30 PM.png

Which can then be setup to perform an action such as transition.  In my screenshot the transition is going to in progress, but it sounds like you want to transition to the In review state instead. 

Try that and let me know if this works in the way you are expecting here.

Andy

이희찬
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!
July 12, 2022

Thank you, Andy. Your solution is amazing. We have succeeded in building satisfactory automation with your answer.

Suggest an answer

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

Atlassian Community Events