Forums

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

Smart value in Automation

Anna Zdzioch January 9, 2025

Hello, 

 

 

I want to create an automation that will verify the value of a field to determine to whom the issue should be assigned. The value of the custom field should contain only numbers in the format XX-XXX. I created the smart value {{issue.customFieldId_10067.match("\\d{2}-\\d{3}")}}, but the automation isn’t working correctly – it doesn’t assign the person, even though I see "success" in the logs.

3 answers

1 accepted

6 votes
Answer accepted
Akash Singh
Community Champion
January 10, 2025

Hi @Anna Zdzioch 

The issue you're facing is likely due to an incorrect reference to the custom field and a slight mismatch in your regular expression.

1. Instead of using {{issue.customFieldId_10067}}, you should use {{issue.customfield_10067}}. If the custom field is a select-type field or any field that returns a complex object, you may need to append an attribute like .value, resulting in something like {{issue.customfield_10067.value}}.

For more details on how to correctly reference smart values, please refer to Atlassian's documentation: Automation smart values - issues | Cloud automation | Atlassian Support.

2. Your current regex \d{2}-\d{3} matches the pattern but doesn't enforce it for the entire string. To ensure the entire value strictly matches the format, you should use this regex:

^\d{2}-\d{3}$

 smartValueCondition.png

0 votes
Anna Zdzioch January 10, 2025

@Akash Singh Thank you very much for your help! Now automation is working correctly.

0 votes
Marc - Devoteam
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.
January 10, 2025

Hi @Anna Zdzioch 

It seems there is a misconfiguration in your smart value. The Id characters part should be in the smart value clause.

Can you try this.

{{issue.customfield_10067.match("\\d{2}-\\d{3}")}}

 

Suggest an answer

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

Atlassian Community Events