Forums

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

Smart values function "contains" missing/not working

Jared Schmitt
Contributor
October 27, 2025

In my automation I'm calling the Atlassian API and want to populate a variable based on the following condition:

{{if(or(webResponse.body.id.contains("customfield_1"),webResponse.body.id.contains("customfield_2")),"fieldsPresent","fieldsNotPresent")}}
The condition always evaluates to false and hence prints "fieldNotPresent".
However, when using an IF block and using a smart value condition 
{{webResponse.body.id}}
CONTAINS
customfield_1
this works perfectly fine.
I'm under the impression it worked in the past. Surprisingly "contains" is not documented (anymore), neither for lists nor for text fields.

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.
October 27, 2025

Hi @Jared Schmitt 

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...

Would you please confirm, are you testing for a match to the value of custom fields in the web response body, or to the literal text "customfield_1"?

And, there is no contains() function in smart values, and thus other methods must be used.

 

Kind regards,
Bill

0 votes
Gor Greyan
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.
October 27, 2025

Hi @Jared Schmitt

Yes, the "contains" is not supported. 
Instead, you can try to use match()

{{if(or(webResponse.body.id.match("customfield_1"),webResponse.body.id.match("customfield_2")),"fieldsPresent","fieldsNotPresent")}}

Please try the above-mentioned one.

Jared Schmitt
Contributor
October 27, 2025

Thank you for the fast reply. I tried that and didn't change the result.

Gor Greyan
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.
October 27, 2025

Dear @Jared Schmitt

If match() also didn't work, it can be because it wasn't applied to a string.

Try this one, please.

{{if(
gt(
webResponse.body.asJsonString.match("(customfield_(?:1|2))").size,
0
),
"fieldsPresent",
"fieldsNotPresent"
)}}

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events