Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automation convert timezone

Yewliang Woo
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!
October 15, 2021

As Jira seems to store the profile user time zone, I need to normalize the specified time by the user. Eg.

Check-in Datetime = 2021-01-01 00:01  

Jira behaves such that when entered, it will store the PROFILE LOCAL TIME ZONE of the reporter. In my case America/Central. If someone from say UTC time zone set in their profile, or even if not set, and Jira had the default of say, CET (Central Europe), then when they see that field, they will see a different Datetime. 

Eg. Someone in UTC time zone will see 2021-01-01 05:01

My use case is to be able specify a plan for people to Check-in to an activity, and to be clear of which time zone the activity is in, as the client has multiple locations. We specify which time zone, and the Datetime. Displayed as:

 

Eg. Check-in "US Central" 2021-01-01 00:01.

The issue then becomes if I am US Pacific, and I enter 2021-01-01 00:01, it will appear  as 2021-01-01 02:01 for the US Central person.

 

I thought the solution would be to have an automation to convert the entered Datetime to a correct timezone of the person's local timezone (eg. If I am in US Central, and I enter for  "US Pacific 2021-01-01 00:01", internally in Jira it will be stored as "2021-01-01 00:01 PT", which I then convert the internal storage with

 {{issue.MW Check-in Datetime.setTimeZone("America/Los_Angeles")}}

 However when ran, the conversion doesn't take place to the field. Is this a bug, or am I doing something wrong? Ie. I am in US Central. Entering 2021-01-01 00:01 would internally store as my time zone (2021-01-01 00:01 CT), and applying setTimeZone("America/Los_Angeles") should then just made the stored time as (2021-01-01 00:01 PT = 2021-01-01 02:01 CT). Instead I got some weird time when redisplaying as 2021-01-01 09:01)!

Image 15.png

Did it take the Jira system time zone (The server's default it CET)?!

 

 

 

1 answer

0 votes
Michael Whitson July 19, 2022

I have the same issue - setup a very similar approach to convert and I am not seeing different values on the timestamps that automation has "converted time zone" on. 

QASIM ALOUDAT
Banned
September 30, 2024

Hello

I am Qasim Aloudat

I am expect that time zone for local.is set from the main github.

Suggest an answer

Log in or Sign up to answer