Automation for Jira: when copying a custom date field to the Target start/end field, the Target field is one day behind

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

When using a rule from the add-on Automation for Jira to copy the value of a custom date field to the Target Start (or Target End) field coming from the add-on Advanced Roadmap for Jira, the Target field is set to 1 day earlier than the custom field.

Note: the issue only occurs if the Jira application is configured with any timezone other than UTC.

Diagnosis

  • The Jira application is configured with a timezone that is not UTC (for example UTC-6)

  • A custom field of date type is created in the page

    ⚙ > Issues > Custom field

    . In the example below, the field is called "End Date Test", and its ID (taken from the URL) is 10300:

    How to find id of a custom field

  • An automation rule is configured in a project via the page Project Settings > Project Automation , so that the value of the custom date field is automatically copied to the Target End field, with the JSON expression using smart values as shown below (note that the custom field ID 10300 is the ID of the custom date field):

1 2 3 4 5 { "fields":{ "Target end":"{{issue.customfield_10300}}" } }
Set target field value in automation using Additional fields
  • When the automation rule is triggered, we can see that the Custom field was set to April 20th, while the Target End date was set to 1 day earlier (April 19th):

    End date and Target date

  • The expected result is that the Target End field should match the custom date field:

    Target field matched end date after rule has run

Cause

The mismatch between the 2 date fields is due to the Advanced Roadmap bug which is tracked in JPOSERVER-2358 - Authenticate to see issue details , and which has been fixed in Roadmap 3.29.9 and 8.20.2.

Solution

You will need to upgrade the Advanced Roadmap to the version that has the fix for the bug mentioned above. Please note that, since Jira 8.15.0, Advanced Roadmap is bundled with Jira. Therefore, the resolution steps are different depending on the Jira version that you are using:

  • for Jira 8.6.0 to 8.14.1: upgrade Advanced Roadmap to the version 3.29.9 by downloading the version 3.29.9 from this page , and uploading it to the Jira application from the page Setting > Manage Apps > Manage Apps

  • for Jira 8.15.0 and above, you will need to upgrade the Jira application to 8.20.2 or any higher version

Updated on May 31, 2024

Still need help?

The Atlassian Community is here for you.