Forums

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

If else in automation is not good to use

flourish_x_yang
May 21, 2026

Version: Jira v10.3.8

Issue description:

1. I can add "If/else block" nested, but it can't. Even if I want to add "Issue fields condition" in a "If/else block" block, it's not allowed.

2. Then I found I can add "Branch rule / related issues", then add "Issue fields condition" in it. But conditions are skipped.

3. Then I moved those "Issue fields condition" to "If/else block", surprise! Issue1 can be achieved via this way. But the conditions are skipped too.

i.e. When the condition 1 isn't matched, it won't check below condition 2. It's not working as a normal If Else logical. Below condition isn't in Else block, they should be executed one by one.

What I expect:

How can I archive the logic like the screenshot? Can I only add lots of "If/else block" for each of them? It's very troublesome and doesn't look good either.

image.png

3 answers

1 accepted

4 votes
Answer accepted
Arkadiusz Wroblewski
Community Champion
May 21, 2026

Hello @flourish_x_yang 

You need to restructure this rule because an If/Else chain only executes the first matching path it finds. If your Epics have multiple components that each need to trigger a Story, use consecutive, independent If blocks instead of a chain so Jira evaluates each one.

Avoid using branches as a workaround since they add unnecessary complexity. If you have a large number of components, splitting this into smaller, dedicated rules is the best way to keep your automation maintainable and your audit log easy to troubleshoot. Other way it will be "Pain to Maintain" 

flourish_x_yang
May 22, 2026

@Arkadiusz Wroblewski My original thought of trying to nested them is to reduce adding the duplicated conditions, like in the picture, same Issue Type, same Affect version, etc.

Anyhow, I achieved it by adding plenty of If/Else block. The cost of doing this is that it requires a lot of repetitive operations.
@Trudy Claspill 

image.png

3 votes
Trudy Claspill
Community Champion
May 21, 2026

Hello @flourish_x_yang 

A series of IF conditions is not the same as an If/Else structure. What you show in your image is a series of IF conditions.

With a series of IF conditions the first condition that returns False cause the the series to be exited. What you described is expected functionality. It is working as designed.

 Please describe in plain language  the problem you are trying to solve by creating an automation rule. Or use pseudo code. And show us your entire rule from the trigger to the final step.

0 votes
Germán Morales _ Hiera
Atlassian Partner
May 22, 2026

Hi,

In Jira Automation, an If/else block behaves like a mutually exclusive chain. Once one condition matches, that branch runs and the later else/if branches are not evaluated. So it will not behave like several independent checks executed one by one.

In your screenshot, if you want condition 1 and condition 2 to both be evaluated independently, I would not put them in the same If/else chain.

A cleaner approach is:

1. Keep the first top-level condition:
- Issue Type = Epic
- Affects Version/s = CAEP_pro_app.hsbc

2. Then add separate blocks for each independent case:
- If: Component/s contains 2.03.Secret_Manager
- Then: create the CTOCAEP Story
- If: Component/s contains 1.1.GCP_GKE
- Then: create the CTOCAEP Story
- If: another component matches
- Then: create the related Story

The key distinction is:

- Use If/else when only one branch should run.
- Use separate If blocks or separate automation rules when multiple checks may need to run for the same trigger issue.

Also, be careful with branches. Atlassian documents that branches cannot be nested in one another and do not support If/else blocks in the same way you might expect from code. If the rule becomes hard to read, splitting it into smaller rules is often easier to audit and debug.

For your case, I would probably keep one rule per target created issue type/project if the conditions keep growing. It will look less compact, but it will be much easier to troubleshoot from the audit log.

Suggest an answer

Log in or Sign up to answer