Forums

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

Another insanely simply question that I am struggling with

Tim Foster
Contributor
April 26, 2022

I have, what I think should be a very simple task.

I want to set my due dates based on remaining time. The remaining time is calculated as a smart value in days {{RemDays}}

I can get the value of RemDays correctly, but I want to use it to determine the new due date. The following works:

{{issue.duedate.plusBusinessDays(6)}}

But no matter what I try, I can't get my smart value passed to plusBusinessDays.

I've tried:
plusBusinessDays({{#=}}{{RemDays}}{{/}})
plusBusinessDays({{RemDays}})
plusBusinessDays(RemDays)

Does anyone know how I can do this? 

2 answers

1 accepted

1 vote
Answer accepted
Stefan Salzl
Community Champion
April 26, 2022

Hi @Tim Foster 

as far as I know variables are of type string.

According to documentation (see link) there is a method to convert to number:

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

 

Could you try to use RemDays.asNumbet when adding?

Best
Stefan

Tim Foster
Contributor
April 27, 2022

@Stefan Salzl you are a genius! I had tried toInt, toDouble but not toNumber. Thank you.

Like Stefan Salzl likes this
0 votes
Filipi Lima
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 26, 2022

Hello!

The first thing I would confirm is whether RemDays is a numeric value since that's the only format the function will accept. After that, see if any of these work:

{{issue.duedate.plusBusinessDays(RemDays)}}
{{#issue.duedate}}func=plusBusinessDays({{RemDays}}){{/}}

If neither of them works and your field is confirmed numeric, share the output of the Automation Rule - what error does it throw?

You can create a Log Action component to check what output your rule is returning as well.

Suggest an answer

Log in or Sign up to answer