Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,555,438
Community Members
 
Community Events
184
Community Groups

smart value output for multiple values

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

2 answers

2 accepted

2 votes
Answer accepted
Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 16, 2023

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: 

https://regex101.com/r/S5MUGe/1

2 votes
Answer accepted
Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 16, 2023

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.

Suggest an answer

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

Atlassian Community Events