Forums

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

Automation Rule date add function does not work.

Sathishkumar Sundaram December 17, 2024

 

Dear All,

Its very encouraging to get response from the community. Thanks for the support.

I am presently facing an issue with Automation rule.

I have an Epic and its child Tasks (6 of them). When I change the start date of my Parent, I should change the child task with the same number of days.

The below code captures the difference.... which works fine.

{{issue.customfield_10015.diff(issue.parent.customfield_10015).days}}

I need to set the start date of my child task (customfield_10015) by adding this difference.

I used a variable to store the difference daysToAdd as number and even stored the converted value to another Variable formattedDaysToAdd using  ({{daysToAdd.asNumber}}

When I am adding the difference to a child issue,  using the below code, 

{{issue.customfield_10015.plusDays({{formattedDaysToAdd}})}}

I am getting an error. "Unable to render smart values when executing this rule:

Failed to get value for issue.customfield_10015.plusDays({{formattedDaysToAdd: {{issue.customfield_10015.plusDays({{formattedDaysToAdd}})}}"
No matter how I try to add, using a formatted variable, it's throwing the same error.
Any guidance here would be a great help to move forward.
Thanks in Advance.

2 answers

1 accepted

3 votes
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 17, 2024

Hello @Sathishkumar Sundaram 

There are a couple of problems that need to be addressed.

When you use a smart value as input to a function you should not put curly braces around it. So you could use your variable thus:

...(variableName)

The second problem is that variables are strings. You can't change the variable storage type by using asNumber. Instead you have to use that when you use the variable with the plus days function:

...plusDays(variableName.asNumber)

Try making those changes and let us know the results.

Sathishkumar Sundaram December 17, 2024

Thanks Trudy, It just worked fine.

0 votes
Sathishkumar Sundaram December 17, 2024

Got a Solution: 

It required an explicit formatting. (.asNumber). Below code works.

{{issue.customfield_10015.plusDays({{formattedDaysToAdd.asNumber}})}}

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