Forums

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

Issue Field condition vs JQL

siond
Contributor
April 25, 2022

Trying to setup an automation with a condition where field A contains 1 to many strings... this JQL doesnt work, and the field condition allows to enter only one string.

Is there a more efficient way for doing this? Can you add multiple strings to a field condition? Comma separated? Or a JQL for 'Contains'?

Field A is also a custom field, text.

 

("Account Type" = "New Lead Bookings" OR "Account Type" = "Top of Funnel" OR "Account Type" = "New Lead CSM/Ecomm" OR "Account Type" = "New Lead TOF Restaurants" OR "Account Type" = "New Lead Restaurants")

1 answer

1 accepted

1 vote
Answer accepted
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.
April 25, 2022

Hi @siond 

For a question like this, please consider posting images of your complete rule and the audit log, showing and details.  Those may provide context for the community to offer help.  Thanks!

What is the type of your field: text, single-select, multiple-select, etc.?

Kind regards,
Bill

siond
Contributor
April 25, 2022

2022-04-25_17-27-30.jpg

 

Thanks Bill, It's not working due to the JQL, stuck on that!

siond
Contributor
April 25, 2022

Looks like a whole list of if/else blocks are my only option? Seems inefficient, and I would have to create a block for every string like this....

2022-04-25_18-05-03.jpg

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.
April 25, 2022

What type of field is Account Type?

Perhaps this syntax would work better:

"Account Type" IN ("New Lead Bookings", "Top of Funnel", "New Lead CSM/Ecomm", "New Lead TOF Restaurants", "New Lead Restaurants")

siond
Contributor
April 25, 2022

I tried 'IN' but as it's a custom text field, single line, it didnt work!

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.
April 25, 2022

It appears from the rule error that EQUALS = did not work, so perhaps try CONTAINS ~ in a stand-alone query first to see if that works for the text field: https://support.atlassian.com/jira-software-cloud/docs/advanced-search-reference-jql-operators/#Advancedsearchingoperatorsreference-CONTAINS-CONTAINS--

("Account Type" ~ "New Lead Bookings" OR "Account Type" ~ "Top of Funnel" OR "Account Type" ~ "New Lead CSM/Ecomm" OR "Account Type" ~ "New Lead TOF Restaurants" OR "Account Type" ~ "New Lead Restaurants")

You may also do this with advanced compare condition with a regular expression:

  • first value: your field's smart value of {{issue.Account Type}}
  • condition: exactly matches regular expression
  • regular expression: (New Lead Bookings|Top of Funnel|New Lead CSM/Ecomm|New Lead TOF Restaurants|New Lead Restaurants)
siond
Contributor
April 25, 2022

The operator '~' is not supported by the 'Account Type' field Doh!

 

Love the idea about the regex never used that before, although it's not working arrrgghh

2022-04-25_18-42-57.jpg

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.
April 25, 2022

Please try the "Contains Regular Expression" option instead for that list.

siond
Contributor
April 25, 2022

I tried that too, and it didn't work :(

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.
April 25, 2022

I re-tested with some similar text in the description field and it worked.  Would you please post an image of your advanced compare condition component in the rule?

siond
Contributor
April 25, 2022

Thanks for your help Bill!

2022-04-25_19-24-27.jpg

This is the text in UPI-13470 im trying to match...

2022-04-25_19-24-54.jpg

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.
April 26, 2022

When I tested this it was with Jira Cloud.  Are you using Jira Cloud or Server/Data Center version?  That image looks like it is from Server/Data Center's pro version (paid) of automation.  The Server/Data Center help seems to match Cloud for the example showing this working.

Let's try to write that smart value to the audit log before the condition to confirm it contains what you expect:

START{{issue.Account Type}}END

If that shows nothing for the field, the smart value is incorrect.  You can determine the correct smart value for your field using this how-to article:

https://confluence.atlassian.com/automation/smart-values-for-fields-993924665.html

siond
Contributor
April 27, 2022

YES! I had to use the custom field and it worked!

2022-04-27_17-51-48.jpg

 

Seriously this is a gamechanger for me, I can use this regex compare for so many things!!

 

THANK YOU!

Like Bill Sheboy likes this
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.
April 27, 2022

Awesome!  I am glad to learn that helped.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events