Hi,
Working with project automation on Jira Server. My use-case is to translate an ISO week string '2053' (i e 2020 w53) to a date.
Field 'Progress Deviation Comment' contains string '2053'.
{{ issue.Progress Deviation Comment.toDate("yyww").jiraDate }}
However, my translation results in date '2020-12-27' (Sunday of w2052) instead of the expected date of '2020-12-28' (Monday of w2053).
Testing indicates that toDate("yyww") use Sunday as first day of week and w2053 and w2101 results in same date:
Doing a check of week number using my locale of Sweden shows the expected week 33.
{{now.locale("sv").weekOfYear}}
I suspect adding locale is required for proper translation to ISO Week date, but I am unable to find any documentation on how to do this translation. Does anyone know?
Best Regards
//Jimmy
Have you tried the convertToTimeZone() function to adjust the dates?
https://confluence.atlassian.com/automation/working-with-dates-993924630.html
And for more information about that locale function, the Atlassian documentation provides a link to here:
https://www.oracle.com/java/technologies/javase/jdk8-jre8-suported-locales.html
Best regards,
Bill
Hi Bill and thanks for the suggestion.
I tried adding convertToTimeZone to my expression (needs locale("sv") in order not to fail rendering in project automation).
Convert IO_WEEK_NUM to date: {{issue.Progress Deviation Comment.toDate("yyww").locale("sv").convertToTimeZone("Sweden/Stockholm").jiraDate }}
But there is no value output:
LogConvert IO_WEEK_NUM to date:
So I did not manage to convert to an ISO WEEK number using convertToTimeZone() function.
B R
//Jimmy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry that didn't work for you, Jimmy.
At this point, I suggest having your site admin submit a ticket to support to see what they can find in the logs (...the ones we cannot see): https://support.atlassian.com/contact/#/
Then please post back here so the whole community can benefit. Thanks!
Until you hear back from them, have you tried a work-around of adding a day with plusDays(1) or toBusinessDay() for the Monday?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.