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
For a question like this, context is important for the community to help. Please post the following:
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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():
This uses size to count the matching values, with a default count of 0, only passing if at least one is found.
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.