Forums

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

Unable to convertToTimeZone for dates from change log

Gokaraju gopi
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 25, 2024

My jira profile time zone is set to Asia/Kolkata.

{{issue.Actual start.convertToTimeZone("UCT").jqlDateTime}} -> Converting to UCT time zone

{{#changelog.Actual start}}{{fromString.toDate.convertToTimeZone("UCT").jqlDateTime}}{{/changelog.Actual start}} - > Not converting to UCT time zone. This is still giving Asia/Kolkata time zone

1 answer

1 vote
Marc - Devoteam
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, 2024

Hi @Gokaraju gopi 

It might be your clause is not completely right.

Can oyu try: 

{{#changelog.Actual start}}{{fromString.toDate.convertToTimeZone("UCT").jqlDateTime}}{{/}} 

Gokaraju gopi
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, 2024

Hi @Marc - Devoteam 

Still it gives Asia/Kolkata time zone

I believe {{#changelog.Actual start}}{{fromString.toDate.convertToTimeZone("UCT").jqlDateTime}}{{/}} is same as {{#changelog.Actual start}}{{fromString.toDate.convertToTimeZone("UCT").jqlDateTime}}{{/changelog.Actual start}}

Marc - Devoteam
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, 2024

Hi @Gokaraju gopi 

I then that when you use the change log option, all information is text and you need to convert the info first to Date Time again, before converting

See following post on the community:

https://community.atlassian.com/t5/Jira-Software-questions/Jira-Automation-How-to-format-date-from-changelog/qaq-p/2516841 

Gokaraju gopi
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, 2024

@Marc - DevoteamI was indeed using toDate but still it is not converting

Marc - Devoteam
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, 2024

Hi as stated in the community post.

You first need to create a variable that gets the value from the change log and then you should convert that to date/time and then convert it.

You could reach out to Atlassian Support, to see of this can be done in a single action, but I don't think so.

Bill Sheboy
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, 2024

Hi @Gokaraju gopi 

Adding to Marc's suggestion:

There are several smart values which, for some reason, cannot be used in / with smart value functions directly in rules.  Instead they collapse to null values and fail silently.  The only way to know this is through experimentation.

The suggested work-around to first save the value in a created variable and then use it later often helps...with the added benefit it can be easily logged for diagnostics.

This technique also helps access dynamically populated fields (e.g., from some addons) and when building dynamic JSON or HTML expressions.

Kind regards,
Bill

Gokaraju gopi
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, 2024

Hi @Marc - Devoteam @Bill Sheboy 

The above approach is not working. What I found was {fromString.toDate}} is treating as UTC time zone by default all though it was logged with Asia/Kolkata timezone. I could convert to other timezones for example {fromString.toDate.convertToTimeZone("Australia/Sydney")}}.

 

Regards

Gopi

Suggest an answer

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

Atlassian Community Events