Automation to update field based on match text in internal comment

Refrez September 28, 2022

Hi, 

I want the automation to update custom field (text) based on the match text in the internal comment

So for example i have custom field "Number"

When Agent write internal comment that contain word "priority" and number X 
is it possible to capture the number and update the field ? 

Example of the internal comment: 
priority 456

then automation update the value of the custom field "Number" with "456"

Thank you :) 

1 answer

1 accepted

1 vote
Answer accepted
Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 28, 2022

Hi @Refrez and welcome to the community,

You can use smart values to get the comment body, and check if it contains the word priority. And after that you can say to the automation, again with smart values, to get the rest of the string, meaning " 456". And then you have to trim it and place this on the field that you want.

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/

However, you have to make sure that the comment will have always the same structure, e.g. "priority XXX"

Refrez September 28, 2022

Hi @Alex Koxaras _Relational_ thanks for the reply,

is my smart values correct? 

{{issue.comments.internal.match(".*priority\*(.*)")}}

The log said "Issues edited successfully" but i'm not see any changes 

 

Thank you :)

Refrez September 28, 2022

it's working now
i use this format: 
{{issue.comments.last.body.match("((?<=priority\s).[0-9]+)")}}

Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 28, 2022

Nice! Good to know you got this thing working!

Suggest an answer

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

Atlassian Community Events