Forums

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

Jira automation branch

Bisrat Shebeshe June 20, 2023

Hi,

 

I wanted to create gitlab branch whenever a jira cloud issue is transitioned to Inprogress. The gitlab repo is integrated and the project is determined by the issue label and Affect version. So issued a template for the automation and designed this logic;

Jira git automation.jpg

So it doesn't create if the label is "no_branch_needed". But if the label is cms and the Affect Version is medical_center, then it creates a branch on cms project, from medical-center branch. If the label is patient-api and the Affect Version is medical-center, then it creates a branch on patient-api project, from medical-center branch.

 

The problem is, there could be 2 or more labels and 2 or more Affect versions. Which means the automation rule executes the rule according to the condition met first, since I have else conditions after the first if branch.

 

I may not have cleared up the condition, please let me know if you need any clarification. Thank you for your help in advance.

1 answer

0 votes
Dan.Tombs
Contributor
June 20, 2023

Hi @Bisrat Shebeshe

 

I think the best way is to witch from the else if statements and actually go to branching. This way the rule will cycle through all branches and not just stop at the first one.

So the rule would now look something like below:

Trigger - transitioned from to do -> in progress

Branch 1

condition - version = XX & label = XX (personally I'd switch away from JQL statements and use the issue fields condition. It is simpler and faster)

Action - Create Git Branch

Branch 2

Repeat for other scenarios

 

 

I'd also remove the no label condition since it wouldn't be required from what I understand of the rule.

Any questions let me know :)

Bisrat Shebeshe June 20, 2023

Hi @Dan.Tombs 

 

Thank you for the answer.

 

There are two branching options on the cloud jira software. Should I use Advanced branching (with smart values) or Branch rule / related issues (for current issue), then add condition for every branch?

Suggest an answer

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

Atlassian Community Events