I have created an automation that updates the Start Date field with the WorkLog Start Date, but the automation seems to fail.
The Error I get:
Hello @Mithun Shetty
Welcome to the Atlassian community.
Where did you get the idea that this was valid syntax?
Also, is Start Date a Date Picker field or a Date/Time field?
If you were looking at this document
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-conditional-logic/
...for the above syntax, notice that the first paragraph says that it works for text fields.
You can accomplish the same thing use a Condition and Edit Action. You'll need to format the worklog.started value as just a date if the Start Date field is just a Date picker.
Thank you @Trudy Claspill
I am new to the whole automation in JIRA. :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That is the short-form version of the conditional logic expression (although there is a typo in shown rule for the location of the parentheses): https://support.atlassian.com/cloud-automation/docs/jira-smart-values-conditional-logic/
However...many field types do not work with the isEmpty() function, particularly date fields. As you described, using a rule condition is better for this scenario.
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.
Thank you. I didn't realize there was a "short form" for the conditional logic syntax. That is a new area for me.
From the referenced document:
The smart values listed on this page can be used with actions where text fields are involved, such as the Add comment or Send email actions.
I took that to mean that the conditional logic could not be used to set values for non-text fields. And in this case the OP is trying to set a date field. Do you concur?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
After some testing...
The conditional expression may be used directly in the field for text and number fields, but I was unable to find an expression that formatted correctly for a date or date / time field. Instead it showed the error: ...must be of the format "yyyy-MM-dd". The same expression works for advanced edit with JSON.
This symptom appears to be caused by the order of processing the escaped characters in the formatting of the date. For example, this would use now() if the Start Date was empty, but only works for JSON and not in the field directly:
{{if(exists(issue.Start date),issue.Start date.format("\"yyyy-MM-dd\""),now.format("\"yyyy-MM-dd\""))}}
I still like your solution better as it is more readable to rule-readers :^) Thanks!
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.