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 ?
For a question like this, context is important for the community to help. Please post the following:
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
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:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.