Using custom variables in date time manipulations

acam November 26, 2024

Hi All! 

As a summary, I have a calculated custom variable that stores a number (could be 3, 5, etc) and thanks to logs I know it stores the value correctly. To make things simple I just put a number there. So, it has the number value, and I can see it on the logs.

 

image.png

 

 

So, I want to use it to make some date calculations, as seen below

 

Screenshot 2024-11-26 at 10.29.16 AM.png

 

Actually, I will update some fields on Jira issue, but for sake of simplicity, I just log the value of calculatedDueDate, which is EMPTY. if I manually type 3 in parenthesis, I see due date + 3 days. But if I use my custom variable, it doesn't work. 

 

I tried it with and without .toNumber, the result is the same. But I confirm that dateShiftInNumber custom variable has the value. So, do you know if there is any rules preventing using custom variables in date time operations? 

Any answer is appreciated! 

Thanks!

 

 

2 answers

2 accepted

2 votes
Answer accepted
Jim Knepley - ReleaseTEAM
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
November 26, 2024

Hi @acam 

You're looking for the .asNumber function, I don't think toNumber exists for smart values.

acam November 26, 2024

Yes, it was my brain shifting between C# and Jira :(

0 votes
Answer accepted
acam November 26, 2024

Yes. The problem was the syntax (isn't it always?)

the correct syntax is .asNumber, not .toNumber

It works as expected now.

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