I have created a variable as below
Then when I wrote a smart value expression to update Date and Time field with the duartion field as 5
{{issue.AT Start Date.plusHours(duration)}}
But it is not updating the Date and time field. Can anyone suggest what is wrong?
Regards,
Dev
First, created variables are text / string types: https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Create-variable
When you want to use them as a number they must be converted, such as with the asNumber function: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#asNumber
For example:
{{issue.AT Start Date.plusHours(duration.asNumber)}}
Next, you appear to have a field named Duration and then you are creating a variable with the same name. Why do that rather than just using the field?
Next, you are referencing a field apparently named "AT Start Date". Smart values for fields are name, spacing, and case-sensitive...and, sometimes the smart value does not exactly match the field display name on the Jira views. When an incorrect smart value is used, it evaluates to null.
Please use this how-to article to confirm you have the correct smart value for your field: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/
Finally, when using created variables, I recommend always adding adding a prefix to avoid confusion with any field names. For example, using the name varDuration instead of duration.
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.