Forums

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

Jira Automation smart value to validate one single Label

Sridhar Gandla
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.
July 24, 2025

Hello,

I am using Jira Data Center 9.12 Version

I am working with Jira automation using smart values and am running into a blocker. When Defects having One single label the Jira Automation works fine.

My Defects used to contain either UAT or PROD Labels i.e. only one single label.

During this time, Defects are having one Label so I happily using smart value either smart value Labels.last or Labels.first then Jira automation works as expected

I was comparing using smart value {{#if(equals(Labels.last, "PROD))}} OR {{#if(equals(Labels.last, "UAT))}} then it works correctly

I was comparing using smart value {{#if(equals(Labels.first, "PROD))}} OR {{#if(equals(Labels.first, "UAT))}} then it works correctly

Post to that, We are decided to add QA_Signoff labels for those defects.

Now, I would like to check the smart value condition either having UAT or PROD in one the Label argument. How do I check the condition ?

 

Labels are getting arranged automatically as per alphabatical order. This is my observation. 

For example, defects are having this kind of labels.

Defect 1: Labels as follows: QA_Singoff UAT
Defect 2: Labels as follows: UAT
Defect 3: Labels as follows: PROD
Defect 4: Labels as follows: PROD QA_Singoff
Defect 5: Labels as follows: A PROD QA_Singoff
Defect 6: Labels as follows: B PROD QA_Singoff

Q1) How to code smart value, by using if condition to check either Defect is having "UAT" Label is one among the label. => It should give Defect1,2,3

Q2) How to code smart value, by using if condition to check either Defect is having "PROD" Label is one among the label. => It should give Defect4,5,6

Q3) When printing those defects then I would like to print all labels

Q4) Is labels are  arranged in alphabetical order ?   

2 answers

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.
July 25, 2025

Hi @Sridhar Gandla 

For a question like this, context is important for the community to help.  Please post the following:

  • an image of your complete automation rule in a single image for continuity
  • images of any relevant actions / conditions / branches
  • an image of the audit log details showing the rule execution

Until we see those...

 

From what you describe, it seems you want to gather and list the issues matching the label values.

Seeing your rule specifics will help to know what to suggest.

Regarding label ordering, I do not believe that is documented and so would not rely upon the labels being in a known order.  Thus, using the regular expression or JQL approaches will help mitigate that.

 

Kind regards,
Bill

0 votes
Evgenii
Community Champion
July 25, 2025

Hi, @Sridhar Gandla 

You'll need to use a different approach.

Labels are a field that stores a list of values. In your current setup, when you're checking whether a specific value is in the list, you're only comparing it to the first or last item. This works with one or two labels, but fails when there are more.

To do this correctly, use an IF/ELSE condition with the OR operator to check if the Labels list contains the value you're looking for.

I’ve created an example to help you understand the logic:

chrome_250725_032.png

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
9.12
TAGS
AUG Leaders

Atlassian Community Events