Forums

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

How to check field against a list of values

Roberto Simoes December 1, 2025

Hi,

I have a field that contains the requester domain, for example @jdoe.com and I would like to create an automation that, based on a list of domains will edit another type (drop-down).

I've tried 2 things below and both failed, any ideas?

1. First i created a smart value condition for my domain field, where the condition contains this regular expression: (^|, )(jdoe-|joed-)

2. I've aso tried this expression {{issue.field.match(".*(jdoe.com|joed.com).*")}}

If anyone has another way to do this would be great, my list of domains is fairly small, more or less 100 items, so  I can keep in the code as above or read from a list somewhere else.

 

Thanks,

Roberto

1 answer

1 vote
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.
December 1, 2025

Hi @Roberto Simoes 

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
  • explain what is not working as expected and why you believe that to be the case

Until we see those...

Please note there is no actual documentation on what is (or is not) supported for regular expression syntax in automation rules.  Instead, the docs only state the underlying implementation is based on Java's Pattern class.

Thus, experimentation is required.  I recommend starting with the simplest thing that could possibly work, testing that, and then incrementally adding edge cases and testing fully.

 

Next, what is the type of the field you are checking / parsing?  For most text fields, using what appears to be an email address could be converted in to one of the markup formats, such as for smart linking...and that may require a different regex.  If instead your field is a select-option field, the smart value expression you show could be incorrect.  Seeing the details of your rule and knowing the field type will help.

 

Kind regards,
Bill

Roberto Simoes December 1, 2025

image.png

 

I've checked all nodes in the logic and all work fine, except this one, as I believe the way I set it up is not correct.

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.
December 1, 2025

First, smart values are name, spacing, and case-sensitive.  When an incorrect one is used, it returns a null value, sometimes collapsing an entire expression to null.

Your condition shows customField_10621 and that should be customfield_10621, in all lower case.

 

One way to diagnose automation regular expression problems is to use the match() function with the expression and write the result with the Log action.

From what you show...

I am guessing that field is a select-option field because you use the value attribute, leading to a list, and because this is a regex check, it creates an implicit text string as if you added join(", ") to the end.

Thus, this would be another way to check that is using the list value iteration and match():

  • smart values condition
    • first value: {{issue.customfield_10621.value.match("^(aig\.com|swissre\.com)").size|0}}
    • condition: greater than
    • second value: 0

This uses size to count the matching values, with a default count of 0, only passing if at least one is found.

 

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