Forums

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

Else/If in jira project automation is not working as expected

Gaurav Pawaskar
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!
September 8, 2025

I am using else if and following is the use case. 

I use 2 tags in Parent Jira tagA or tagB. Either of these 2 tags are added to the parent jira (both can not be present at same time.) while creating the issue.

I created automation rule that does

if block 

{{smart values}} condition 

First value {{triggerIssue.labels.distinct()}} 

condition contains 

second value tagA

// Create another issue and link to parent

Else if block 

{{smart values}} condition 

First value {{triggerIssue.labels.distinct()}} 

condition contains 

second value tagB

// Create another issue and link to parent

When I add tagA to parent jira it works correct. 

When I add tabB to parent jira it does not work for elseif part and Audit log says "The following work items did not match the condition: <Parent Jira ID>"

 

3 answers

0 votes
Gaurav Pawaskar
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!
September 8, 2025

Following image is my if blockScreenshot 2025-09-08 at 12.13.02 PM.png

This is my else if block

Screenshot 2025-09-08 at 12.13.24 PM.png

When I create issue with 3rd-party-Review tag. It does match the condition and execute rest of the blocks

But for Else if condition it fails to match condition when I create issue with ProdSec-review tag

Following is the audit log for No action performed

Screenshot 2025-09-08 at 12.16.27 PM.png

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.
September 8, 2025

Hi @Gaurav Pawaskar -- Welcome to the Atlassian Community!

Would you please post images of your complete rule, the conditions, and the audit log details showing the rule execution?  Seeing the actual content may help explain what you are observing.

Until we see those...

Labels cannot contain duplicates, although they can contain values with different capitalization.  And so using the distinct function has no impact for this scenario.  What were you hoping that function would help do?

Are you trying to create the same or different work items based upon the label?

 

Kind regards,
Bill

0 votes
Trudy Claspill
Community Champion
September 8, 2025

Hello @Gaurav Pawaskar 

Welcome to the Atlassian community.

Can you provide a screen image showing your entire rule?

Can you provide screen images showing all the details of the rule execution audit log entry?

 

The way an If/Else-if block works is that the first condition to match is the only branch that executes. These are either-or types of checks.

If the conditions in the initial IF block are matched, none of the other Else-if blocks will be examined.

If the conditions in the initial IF blocked are not matched, then the following Else-if conditions are examined. If those are matched, then no additional Else-If blocks' conditions will be examined.

 

What is it that you want to accomplish with this automation rule? Describe it in words rather than in code. Example

When I add a value to a Labels field, I want the Labels values to be reviewed and an issue created for each Labels value. However, if the labels field already has values and I add more values, I want issues created only for the new values that I added to the labels field. And I want this rule to be triggered when a new issue is created and when just the Labels field is edited.

Trudy Claspill
Community Champion
September 8, 2025

Hello @Gaurav Pawaskar 

Thank you for providing the images.

Can you show us a screen image of the issue mentioned in that Audit Log - PSOH-4300 - so that we can see the value of the Labels field?

Gaurav Pawaskar
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!
September 8, 2025

Screenshot 2025-09-08 at 12.48.20 PM.png

Trudy Claspill
Community Champion
September 8, 2025

Thank for that additional image.

Your rule can be simplified by using a Work Items Field Condition rather than a smart values condition. I did that in a test rule, and the rule correctly detected the Labels value for the Else-if branch.

 

I believe the reason your rule is not working is because the text in the actual label is not an exact match to the value you have in the condition. The value has an upper case "R" for review, and the value you have in the compare is a lower case "r".

Gaurav Pawaskar
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!
September 8, 2025

I checked the rule. Value I am comparing in rule is ProdSec-Review and value in label is ProdSec-Review. I do not see any casing issue here. 

I am not seeing any issue. What I am missing?

Trudy Claspill
Community Champion
September 8, 2025

You are correct. My mistake.

Double check if the value you are using in your comparison includes a leading or trailing space.

Otherwise I'm not sure why it would not work for you. I recreated the scenario you have using the same smart value comparison you have, and it worked for me. It also works for me to use the simpler Work Items Field Condition rather than a smart value comparison.

 

Gaurav Pawaskar
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!
September 8, 2025

I converted to simpler Work Items Field Condition, as you recommended and I see the same behavior. 

While you are testing can you add few more labels along with ProdSec-Review while creating issue. 

So far if I have only one label "3rd-Party-Review", this is working fine but when I have "ProdSec-Review" along with more labels I am seeing issue. 

This is my guess. Please check if you see same issue.

Suggest an answer

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

Atlassian Community Events