Forums

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

Cannot calculating date using a smart value in Jira Automation

Adrianna Bell September 28, 2025

At the beginning of my automation, I have a variable created called Digit.  It uses this {{issue.labels.match(".*?(\\d+)$")|number}} and my log files indicate it is populating correctly.  

Now I am trying to create another date variable based on label values but no matter what syntax I use, I can't get it to accurately calculate the date I need.  Within my if statement, the formula I'm trying to create is based on Digit=nth day of the next month.

These are the values I've tried and their respective output but can't seem to find the correct combination using my Digit variable. I saw one article that indicated I should use {{#now}}func= but I'm not clear on the difference between using that and using using {{now}}.  The first formula listed below is what I need but I need to use my variable Digit instead of hard-coding the 13. This is making me crazy!! 

Formula

Output

{{now.endOfMonth.plusBusinessDays(13).shortDate}}

10/17/25 CORRECT

{{#now}}func=endOfMonth.plusBusinessDays(13).shortDate{{/}}

INCORRECT – 2025-09-28T21:05:43.8-0400 doesn’t appear to have calculated anything in the function

{{#now}}func=endOfMonth.plusBusinessDays(Digit).shortDate{{/}}

INCORRECT – 2025-09-28T21:05:43.8-0400 doesn’t appear to have calculated anything in the function

{{now.endOfMonth.plusBusinessDays(Digit).shortDate}}

No result

{{now.endOfMonth.plusBusinessDays(Digit.asNumber).shortDate}}

No result

{{now.endOfMonth.plusBusinessDays({{Digit}}).shortDate}}

error Failed to get value for now.endOfMonth.plusBusinessDays({{Digit:

2 answers

1 vote
Trudy Claspill
Community Champion
September 28, 2025

Hello @Adrianna Bell 

Variables are stored as strings. If the content is a number and you want to use it as a number in a smart value then you need to use the asNumber function to convert it.

Digit.asNumber

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.
September 29, 2025

Hi @Adrianna Bell 

Without seeing your entire rule and audit log details...

As @Trudy Claspill notes, created variables are text and need to be converted with asNumber to use numeric function parameters.

And, you describe filtering the Labels field with a match() and storing that as a created variable.  This could produced a list of values delimited by a comma-space.  Have you written that variable to the log to check if it contains multiple values or unexpected characters?

 

Finally, here are some additional tips on using created variables as numbers in an article I wrote:

https://community.atlassian.com/forums/Automation-articles/Automation-concepts-Using-Created-Variables-as-Numbers/ba-p/2953116

 

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer