Automation in JIRA | Correct Timezone
Asked by Mareli:

Hello All,   

I created this automation to update the summary when a field value changes:  

![Screenshot 2024-08-13 at 16.57.53.png](https://community.atlassian.com/t5/image/serverpage/image-id/341538i915C650003F576C5/image-size/large?v=v2&px=999 "Screenshot 2024-08-13 at 16.57.53.png")  

I have managed to get the date format the way I want it but I am struggling to set the correct time in the summary.   

In the Automation the date field referees to customfield_12025 which is the "Start Date ann Time (DP)" field:   

![Screenshot 2024-08-13 at 17.00.38.png](https://community.atlassian.com/t5/image/serverpage/image-id/341539i1B526B1170307791/image-size/large?v=v2&px=999 "Screenshot 2024-08-13 at 17.00.38.png")  

As you can see the time is set to 2:30 PM.  

But when I trigger the Automation the wrong time comes up, the time reads 12:30 instead of 14:30 or 2:30 PM:  

![Screenshot 2024-08-13 at 17.02.24.png](https://community.atlassian.com/t5/image/serverpage/image-id/341540i8C250D8AD37B9641/image-size/large?v=v2&px=999 "Screenshot 2024-08-13 at 17.02.24.png")  

I've tried the following to get the correct time:  

1. {{issue.customfield_12025.format( "EEE, dd MMM yyyy HH:mm 'CAT'").convertToTimeZone(SAST)}}
2. {{issue.customfield_12025.format( "EEE, dd MMM yyyy HH:mm 'SAST'").convertToTimeZone(SAST)}}
3. {{issue.customfield_12025.format( "EEE, dd MMM yyyy HH:mm").convertToTimeZone(SAST)}}
4. {{issue.customfield_12025.format( "EEE, dd MMM yyyy HH:mm").convertToTimeZone(CAT)}}
5. {{issue.customfield_12025.format( "EEE, dd MMM yyyy HH:mm 'CAT'")}}
6. {{issue.customfield_12025.format( "EEE, dd MMM yyyy HH:mm 'SAST'")}}

None of these seem to work they just leave out the date and time completely, like this:  

![Screenshot 2024-08-13 at 17.04.58.png](https://community.atlassian.com/t5/image/serverpage/image-id/341541i21BCB99F17CB7875/image-size/large?v=v2&px=999 "Screenshot 2024-08-13 at 17.04.58.png")  

Any advice?


Answers:
author: Trudy Claspill
body: Hello [@Mareli](/t5/user/viewprofilepage/user-id/5418129)

I have two recommendations.

First try swapping the time zone conversion and format functions. Both apply to a date/time value, but with the current order you are trying to apply timezone conversion to a formatted string. Try this order:

{{issue.customfield_12025.convertToTimeZone().format()}}

Second, I don't think the codes you are trying for time zone conversion are valid. In the documentation for the time zone conversion function...

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

...there is a link to a document from which you can get the valid entries to use for all the time zones.

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

I don't see SAST or CAT in that list.

comments: author: Mareli
body: Hi [@Trudy Claspill](/t5/user/viewprofilepage/user-id/3569011)   

IT WORKED!   

Thanks so much:  

![Screenshot 2024-08-13 at 17.42.41.png](https://community.atlassian.com/t5/image/serverpage/image-id/341549iA17AEF389A23A738/image-size/large?v=v2&px=999 "Screenshot 2024-08-13 at 17.42.41.png")  

I used this one:   
{{issue.customfield_12025.convertToTimeZone("UTC+02:00").format("EEE, dd MMM yyyy HH:mm")}}


author: Marc - Devoteam
body: Hi [@Mareli](/t5/user/viewprofilepage/user-id/5418129)

Could you try {{issue.customfield_12025.jiraDate}}

comments: author: Mareli
body: Hello [@Marc - Devoteam](/t5/user/viewprofilepage/user-id/3796976)   

This one did not work it does not give me the time and also the format is not correct  

![Screenshot 2024-08-13 at 17.36.39.png](https://community.atlassian.com/t5/image/serverpage/image-id/341548iB2BF9BD9B1DBFD48/image-size/large?v=v2&px=999 "Screenshot 2024-08-13 at 17.36.39.png")


Tags: cloud

jira-cloud