Forums

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

Populating a custom field with a substring from Summary

Vinicius Zhu July 15, 2022

I have a custom field I want populated with a piece of my Summary. I wrote a regex to help me doing that, and I validated it here.

(PRJ|INC|PRB|RITM|TASK|VUL|CHG|\wTASK)(\d+)

I created an automation rule, triggered whenever an issue is updated, trying to match this regex in my summaries:

if.PNG

And it works. Not only I see the SUCCESS status in Audit log, but also, I see the issue being updated by the rule:

audit.PNG

However, the rule itself isn't updating the issue the right way. Here is how I set the rule (I tried not using the "additional fields" and choosing my custom field on the above dropdown instead, but got the same results). This is the update rule:

rule.PNG

And this is the result I get:

ticket.PNG

 

Apparently, even though the "comparison regex" matches the entire Ticket Number (PRB1234567), the "update regex" gets only the first characters and ignore the numbers.

Any hints?

Thank you!

1 answer

1 accepted

1 vote
Answer accepted
Kian Stack Mumo Systems
Community Champion
July 15, 2022

@Vinicius Zhu, you're really close! One modification is all you need. Wrap the two capture groups in another set of parens.

 

{{issue.summary.match("((PRJ|INC|PRB|RITM|TASK|VUL|CHG|\wTASK)(\d+))")}}

Vinicius Zhu July 15, 2022

Ahh, that makes sense! Worked like a charm!! Thank you!!!

Suggest an answer

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

Atlassian Community Events