I am working on a smart value in an automation rule action that will send out an email when an issue is created. In the email body I am trying to get the issue description for multiple values but broken down per line. At the moment, with what I am using below I am only getting the first word resolved. My goal is to get all words/numbers,etc to display for each value:
Alert : {{issue.description.match(".*Alert : (\S+).*")}}
Start Time : {{issue.description.match(".*Start Time : (\S+).*")}}
End Time : {{issue.description.match(".*End Time : (\S+).*")}}
currently this is the output i get in the description of the new issue created:
Alert : Alert
Start Time : 04/17/2023
End Time : 04/17/2023
looking for this output:
Alert : Alert DESC
Start Time : 04/17/2023 09:00:00 AM
End Time : 04/17/2023 12:00:00 PM
I was thinking this could be much simpler if the "field names" are consistent.
So just for clarity, is this an accurate example of what your Description field might look like?
Text at the beginning
Alert : Alert DESC
Some other text blah blah
Start Time : 04/17/2023 09:00:00 AM
End Time : 04/17/2023 12:00:00 PM
Other text etc etc
If so, then I think this should work:
Alert : {{issue.description.match("Alert : (.+)")}}
Start Time : {{issue.description.match("Start Time : (.+)")}}
End Time : {{issue.description.match("End Time : (.+)")}}
At least it seemed to work when I messed around with it here:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Your match is removing DESC and the time stamps because the match function is only returning the first one as stated in the documentation.
Performs a regular expression search and returns the first (and only one) matching regular expression group.
Try using \S+\s\S+ and see if that helps.
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.