Automation for Jira DC smart value formula not working
Asked by Lior Efraim:

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.


Answers:
author: Lior Nesher
body: 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](/t5/user/viewprofilepage/user-id/1685313) 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))}}

<br />

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

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

comments: author: Lior Efraim
body: 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!


author: Bill Sheboy
body: Hi [@Lior Efraim](/t5/user/viewprofilepage/user-id/4520606)

Please review the [math expression syntaxes](https://confluence.atlassian.com/automation/jira-smart-values-math-expressions-993924866.html), 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

comments: author: Lior Efraim
body: 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.


author: Kelly Arrey
body: Hi [@Lior Efraim](/t5/user/viewprofilepage/user-id/4520606) can you show us the details of the part of the rule where you set the Finish Date value? Thanks!


author: Lior Efraim
body: sure. please see screenshot

![Capture2.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/348751i3849F6D8CD8AD4CC/image-size/large?v=v2&px=999 "Capture2.PNG")


author: Kelly Arrey
body: LGTM. [@Lior Efraim](/t5/user/viewprofilepage/user-id/4520606)

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?


author: Bill Sheboy
body: 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>


Tags: formula

smart-value