How to fix error parsing time error in automation rule?

Kaitlyn Vu December 26, 2023

Hi all, 

I'm currently having trouble when configuring an automation rule. Kindly see the below details:

Version: Jira Data and Center 5.11.2

In an issue type, I have a custom field named Incident Fixed (Date Time Picker Type). For this field, I want only users with project role Administrator can edit it, other users are not allowed to edit.

I researched and discovered an automation rule to revert to previous value which could be helpful, following the documentation https://confluence.atlassian.com/jirakb/how-to-prevent-or-revert-field-changes-using-automation-rules-in-jira-1188424037.html 

Here's how I configure: 

sss.pngdsdd.pngdssd.png

Here's my custom field:

ssssss.png

I succeed in keeping the value inputted by role Administrators. However, for other project roles, value is not reverted. For example:

- Current value for Incident Fixed is 25/Dec/23 12:00AM.

- If I'm an Incident Manager project role, I edit the field to 26/Dec/23 12:00AM, then that is the latest value, while it should revert to 25/Dec/23 12:00AM.

I checked the audit log of automation rule and got below error.

vsdgvdscgv.png

I'm not sure what "error parsing time" is. Please assist to help me to solve this error. 

Thanks all! 

1 answer

1 accepted

0 votes
Answer accepted
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.
December 27, 2023

Hi @Kaitlyn Vu -- Welcome to the Atlassian Community!

First thing, I am using Jira Cloud and not the Data Center version.  And so my answer is based on what I know of automation rules.  Please test what I suggest with your version of Jira.  Thanks!

In your rule you are using the {{fromString}} smart value for the field, and it appears the text cannot be parsed correctly as a date / time: https://confluence.atlassian.com/automation/smart-values-993924860.html#Jirasmartvaluesissues-fieldChangefieldChange

There are two things you could try:

  1. Try converting that to a date time by adding the toDate() function, with a format that match your field: https://confluence.atlassian.com/automation/examples-of-using-smart-values-with-dates-993924630.html#Examplesofusingsmartvalueswithdates-Convertingtexttodates
  2. Try using the raw (object) data rather than the text version.  That would be: {{fieldChange.from}}

 

Kind regards,
Bill

Kaitlyn Vu January 2, 2024

Hi @Bill Sheboy 

I tried with Option 1 and it worked!!!! Your provided documentation links are really helpful. Appreciate it!!! 

Thank you very much! Have a nice day!

Best Regards, 
Kaitlyn. 

Kaitlyn Vu January 10, 2024

Hi @Bill Sheboy Sorry to trouble you again. 

Thanks to your instructions before, I've used smart value {{fieldChange.fromString.toDate}}. However, as our team tested today, it seems that it only works with Date. The time is reverted incorrectly. 

For details: 

  • Incident Fixed's current value is 11/Jan/24 7:04 PM.
  • Administrator changed to 11/Jan/24 4:04 AM --> Successfully changed, no issue. 
  • Incident Manager changed 11/Jan/24 4:04 AM to 11/Jan/24 5:04 AM --> At this step, value is reverted to 11/Jan/24 12:04 PM, while it should be 11/Jan/24 4:04 AM.

Could you help to support me on solving this issue? Should this relate to timezone settings?

I'd really appreciate your help. Hope to hear from you soon.

Thank you very much! 

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.
January 11, 2024

Hi, Kaitlyn!

That appears to be time zone related.  When you convert the text using toDate() that could be followed by a set (or convert) of the time zone.  Please look here to find those functions for your version of Jira: https://confluence.atlassian.com/automation/jira-smart-values-date-and-time-993924864.html

I recommend writing the values to the audit log incrementally to confirm they work as expected while trying to address this one.

PW
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!
May 10, 2024

Another solution for the parsing time error while setting date/time picker custom field on a webhook response by using "toDate" and "jiraDateTime".

example:

{{webhookResponse.body.result.start_date.toDate("yyyy-MM-dd HH:mm:ss").jiraDateTime}}

Suggest an answer

Log in or Sign up to answer