Automation for filling in Customfield using Smart value

Søren Hansen April 18, 2024

I want to make a JIRA automation that does the following:

At creation of an issue, if the description contains a 7 digit number in (), move that number from description to the custom field named IMO Number

Se pictures. 

{{#issue.description.matches("\\((\\d{7})\\)")}}{{issue.description.matches("\\((\\d{7})\\)")‌​[0].group(1)}}{{/}}2024-04-19 08_31_11 JIRA.png2024-04-19 08_32_55-JIRA.png

2 answers

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 19, 2024

Hi @Søren Hansen 

For Jira Cloud automation rules, please see this documentation for the match() function and its use of regular expressions:

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#match--

The match() function returns a list of matches.  To access a specific one, please use the get() function for a list:

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-lists/#list.get-index-

Kind regards,
Bill

0 votes
Dick April 18, 2024

According to documentation on regex and Jira, you needn't escape the curved brackets:: 
Regex validation | Atlassian Support | Atlassian Documentation

Suggest an answer

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

Atlassian Community Events