Automation rules relying on date and time functions fail on timezone change

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

An automation for Jira rule that uses a date/time function might fail in a datacenter setup when there are multiple nodes and cluster nodes have different timezones.

Diagnosis

After enabling the debugging package com.codebarrel, an error will be logged to Jira-Home /log/atlassian-jira.log stating that a date/time function didn't work correctly. In the following example, now.plusBusinessDays(2) was not conclusive and didn't return a value.

1 stateChange=SOME_ERRORS, payload=MessageComponentChange{type=ERROR, key='com.codebarrel.automation.rule.mustache.error', appendParameters=[Failed to get value for now.plusBusinessDays(2): {{now.plusBusinessDays(2)}}]}}'}

Cause

One or multiple nodes of the cluster have a different timezone on the operating system level because of a misconfiguration or day light time saving change.

Solution

  • Make sure that all nodes report the same timezone

  • Go to Settings> System > System info, and ensure that all the timezone values match (System Time, User Timezone, jvm.system.timezone) across all nodes

  • Jira use the Operating System timezone by default, verify that all nodes are synchronized and display the same timezone

  • If it is not possible to change the operating system timezone, you can force it on the JVM level using a startup property and match the rest of the nodes

User timezone

-Duser.timezone=

Updated on June 11, 2024

Still need help?

The Atlassian Community is here for you.