Hello!
My customer has the following requirement:
Changes with a planned downtime of more than 14 days should be labeled.
The fields “Planned Downtime Start” and "...End” are date/time picker fields.
I use the following SmartValue for the calculation, but unfortunately it does not return a value:
{{Planned Downtime End.jiraDate.diff(Planned Downtime Start.jiraDate).days}}
I output the calculation in the logs:
----
Log
Planned downtime in days: <EMPTY>
----
I also tried to use the custom field IDs with the same result.
Does anyone have any idea where my mistake might be?
Thanks and best regards,
Daniel
The diff() function takes date or date / time values: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/#Date-difference---
But, you have added the jiraDate format, which converts the values to text...preventing the diff() from working. Please try removing that formatting.
And...Smart values are name, spacing, and case-sensitive, and often do not exactly match the field names displayed on the Jira pages. When an incorrect one is used, that returns as null, often leading to unexpected results.
Please use this how-to article to identify the correct smart value (or custom field ID) for your fields before you proceed:
https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/
Kind regards,
Bill
That did the job! Thank you very much!
I have removed the ".jiraDate" and the automation now runs and does the job.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need to specify the smart values part issue.<customfield-name>
What is the output in the log if you simply use:
{{issue.Planned Downtime End.diff(issue.Planned Downtime Start).days}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks!
I was able to resolve this with using the field names, but, i think it would be a better practice to use the field IDs, as you mentioned.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.