Why isn't convertToTimeZone working as expected?

Bentley_ Andrea February 26, 2025

I'm using Jira Software Cloud, and I've got an automation to set the Due Dates of each issue relative to the Sprint's End Date. For example, Dev tasks need to be completed 5 business days before the end of the sprint. Because the Sprint's End Date is stored in UTC, I keep getting a date that is one day ahead. I have tried to convert to my time zone (US/Eastern), but it doesn't seem to be working? Just to test it, I set up an automation that only writes to the Audit Log.

Here is my Sprint information: jira-sprint-info-2025-02-26_20-46-45.jpg

The end date is actually 3/25, but I assumed once I converted "3/26/2025 12:00 AM" from UTC to US/Eastern, it would be 3/25.

This is what I'm logging in the automation: jira-log-time-zones-2025-02-26_21-11-03.jpg

 

And these are the results in the Audit Log:

jira-time-zone-issues-2025-02-26_21-09-32.jpg

Why are the converted dates still 3/26 and not 3/25? What am I missing?

3 answers

0 votes
Vishal Biyani
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.
February 26, 2025

@Bentley_ Andrea 

As per the documentation only time part is converted not the date.

snip.png

0 votes
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.
February 26, 2025

Hello @Bentley_ Andrea 

You are not specifying valid timezones for the conversion function.

As per the documentation for the function:

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/#Convert-timezone-date---

Valid timezone codes can be found here:

https://joda-time.sourceforge.net/timezones.html

That list does not include codes such as "UTC-06:00".

For the U.S.A. east coast timezone the valid codes are:

  • America/New_York
  • US/Eastern
Bentley_ Andrea February 26, 2025

I AM using "US/Eastern" in the second example. I also tried "UTC-5" which I saw as another way to do it. 

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.
February 26, 2025

My apologies. I overlooked that among the examples.

0 votes
Bentley_ Andrea February 26, 2025

As a workaround, I'm now using: 

{{issue.sprint.endDate.convertToTimeZone("UTC-06:00").jqlDate}}

And to get the Developer Due Date:

{{issue.sprint.endDate.convertToTimeZone("UTC-06:00").minusBusinessDays(5).jqlDate}}

But I'd still like to understand why converting to my time zone didn't work?

Is the Sprint's End Date of 03/26/2025 12:00 AM already the Eastern time zone? And I just needed to subtract a minute?

Suggest an answer

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

Atlassian Community Events