Forums

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

Update a custom field when i detect a specific text from summary

Steven Dahdah
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 15, 2023

Hey All,

 

Can you let me know how I can create an automation rule to extract a specific number from a summary?

 

For example, I have the summary below:

Car ID 1525 has an issue in location 100.

 

I want to extract 1525 and place it in a custom field.

Also, I would like to extract the text "Car" to save in another custom field.

 

Is this can be done?

1 answer

0 votes
Alex Koxaras -Relational-
Community Champion
March 15, 2023

Hi @Steven Dahdah and welcome to the community,

You can achieve what you want by using smart values, especially the "substring: smart value.

  • substring(int start)
  • substring(int start, int end)
  • substringAfter( String separator)
  • substringAfterLast(String separator)
  • substringBefore(String separator)
  • substringBeforeLast(String separator)
  • substringBetween(String open, String close)

However, prior of doing this, you have to make sure that all tickets are raised with a specific structural format e.g. the following subject "Car ID 1525 has an issue in location 100" should always be in the format of:

text_you_want_to_extract ID number_you_want_to_extract rest_of_the_subject

It would be easier if you had certain special and unique characters which would identified the selected words you want to extract, e.g.:

| Car | ID ^1525^ has an issue in location 100

Then you could use the {{substringBetween("|","|")}} to get the first value and  {{substringBetween("^","^")}} to get the next value.

After doing that you simply add an "Edit" component and insert the above smart values as field values.

Suggest an answer

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

Atlassian Community Events