Create Automation for Start Date based on work log Start Date

Mithun Shetty
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 17, 2024

I have created an automation that updates the Start Date field with the WorkLog Start Date, but the automation seems to fail.

JIRA_1.pngJIRA_2.png

 The Error I get:

JIRA_3.png

1 answer

1 accepted

2 votes
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 17, 2024

Hello @Mithun Shetty 

Welcome to the Atlassian community.

Where did you get the idea that this was valid syntax?

Screenshot 2024-04-17 at 12.27.57 AM.png

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.

Screenshot 2024-04-17 at 12.44.28 AM.png

Mithun Shetty
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 17, 2024

Thank you @Trudy Claspill 

I am new to the whole automation in JIRA. :)

Like Trudy Claspill 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.
April 17, 2024

Hi @Trudy Claspill 

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

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 17, 2024

@Bill Sheboy 

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:

 

Jira smart values - conditional logic

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?

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.
April 17, 2024

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!

Like Trudy Claspill likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events