Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,463,032
Community Members
 
Community Events
176
Community Groups

ConvertToTimeZone not working

Edited

Hello community, 

I have a simple automation rule that set OLA/SLA target times based on creation date-time of a given ticket.

As I want to setup different timezones depending on the project/customer location (so timer is set on local time), and understanding that ticket creator personal settings are being taken to define the timezone, I want to make sure that the times are always converted to the expected timezone for that given project (e.g. Europe/Madrid).

To do so, im using the following expression to edit a custom field:

  • {{issue.Created.convertToTimeZone("Europe/Madrid").plusMinutes(15)}}

The expectation is that irrespective of the timezone setting of the ticket creator (even if not defined, it will take default system value), the creation date is always converted to the timezone I define, but this is not working properly. Here some real examples:

  • This rule takes the creation date and convert it to Bolivia time (using canonical id as indicated in documentation), and add the defined time (15mins and 4hours for Response Time and Resolution Time respectively):
    • Rule Config:
      • Screenshot 2022-05-12 at 11.40.59.png
    • Creation date timestamp for a random ticket chosen:
      • Screenshot 2022-05-12 at 11.50.42.png
  • The expected results for automation are:
    • OLA Response Time Target = May 12, 2022, 5:32 AM ----> Bolivia timezone (-6 hours from my time) + 15 mins

    • OLA Resolution Time Target: May 12, 2022, 9:17 AM ----> Bolivia timezone (-6 hours from my time) + 4 hours

  • Actual results are:
    • OLA Response Time Target = May 12, 2022, 11:32 AM ----> Madrid timezone (the same timezone defined on my profile) + 15 mins

    • OLA Resolution Time Target: May 12, 2022, 3:17 PM ----> Madrid timezone (the same timezone defined on my profile) + 4 hours.

      • Screenshot 2022-05-12 at 11.50.29.png

Tried changing convertToTimeZone to SetTimeZone expressions among many other combinations, but always get unexpected results. Not sure if al this is correcto and this is because of the viewer will always see the datetime on local time; if Im doing something wrong; there is a config that overwrites/mess-up my calculations... or it this post does make any sense at all :)

This is a key setup I need as I have multiple projects and countries all over the world so want to make sure the timezone are always correct, irrespective of creator or system config.... Any hint?

Thanks in advance, 

Esteban

1 answer

0 votes

Hi @Esteban Borja Lopez 

My understanding of the time zones, in regards to automation rules, is that they impact: 

  • date/time math when operating on different fields/smart values, such as with the diff() function
  • and presentation of results as text, such as in a comment or email

For each individual user, I would expect presentation of date/times to match their profile.

Are you wanting all users to see the same time zone values, regardless of their physical location and profile settings?

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events