Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Automation for Jira DC smart value formula not working

Lior Efraim September 22, 2024

Hello,

 

i have a field called "Start Date", a date field (no time)

another field "Sprints Estimation" which is number field.

i want to set a value of another date field - "Finish Date" to be:

Finish date = Start date + (Sprint estimation)  * 21 

 

this is what i tries and getting error parsing from automation:

option 1: {{#=}}{{issue.startDate.plusDays({{issue.sprintsEstimation}} * 21)}}{{/}}

option 2: {{issue.startDate.plusDays({{#=}}{{issue.sprintsEstimation}} * 21{{/}})}}

 

 

any ideas?

thanks im advance to any answer.

2 answers

1 accepted

2 votes
Answer accepted
Lior Nesher September 25, 2024

Hi Lior,
One small correction you used custom field "Start Date" and call it to "StartDate" you can use the space.
that error might be happen again in  @Bill Sheboy solution isn't worked for you, you used 'sprintsEstimation' together, and my guess the field called 'Sprints Estimation'.

{{issue.Start Date.plusDays(issue.Sprints Estimation.multiply(21))}}


to avoid those kind of mistakes my tip is using the custom field id

{{issue.customfield_xxxxx.plusDays(issue.customfield_xxxxx.multiply(21))}}

Lior Efraim September 25, 2024

Thanks Lior!

 

what worked for me was:

{{issue.Start Date.plusDays(issue.customfield_17909.multiply(21))}}

 

just need to remember changing the  number in customfield_xxxxx when moving this to prod.

 

thanks again!

Like Steffen Opel _Utoolity_ likes this
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 22, 2024

Hi @Lior Efraim 

Please review the math expression syntaxes, and then try this one:

{{issue.startDate.plusDays(issue.sprintsEstimation.multiply(21))}}

And, when using a smart value nested within another function, the extra curly brackets are usually not needed.

Kind regards,
Bill

Lior Efraim September 23, 2024

Thank you Bill.

result is "success" from the automation, and "Issues edited successfully" but "Finish Date" stays empty.

 

i tried add "jiraDate" to the statement as i saw in documentation:

{{issue.startDate.plusDays(issue.sprintsEstimation.multiply(21)).jiraDate}}

but still same thing, i get success with no value in the field it stays empty. 

Kelly Arrey
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 23, 2024

Hi @Lior Efraim can you show us the details of the part of the rule where you set the Finish Date value? Thanks!

Lior Efraim September 23, 2024

sure. please see screenshot

 

Capture2.PNG

Kelly Arrey
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 23, 2024

LGTM. @Lior Efraim 

  1. You might want to put some "Add value to audit log" actions in there to print some intermediate results of the smart value expression to the logs to help understand what's happening a little better.
  2. One other thing that sometimes bites people is, are there two fields named "Finish Date" on your system? 
Like Bill Sheboy likes this
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 23, 2024

Yes, and...have you confirmed you have the correct smart value for your custom field sprintsEstimation?  You can do that using this how-to article:

https://confluence.atlassian.com/automation/find-the-smart-value-for-a-field-993924665.html

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events