JMWE Cloud: Which time zone is used by default?
Problem
When setting a field with a timestamp generated by JMWE, the process doesn’t use the Jira system time zone.
Solution
By default, JMWE assumes a UTC +0 time zone unless a time zone has been manually specified. This is typically not an issue when setting a date/time field, as Jira can handle user time zones, but it will display time from another time zone to most users when it’s set to a text field.
To circumvent this issue, you can use Nunjucks date filters to format the time and date. date filter | tz
For example:
{{ now | date('tz') }}outputs the current time for the user that runs the post function and returns it as a Moment.js object. This will be output as Unix time in milliseconds in a text field.{{ now | date('tz') | date }}outputs the current time in a human-readable format, factoring the post function user’s time zone.{{ now | date('tz',"Asia/Kolkata") | date('dddd, MMMM Do YYYY, h:mm:ss a') }}displays the current time, assuming the time zone in Kolkata, India, in the specified formatdddd, MMMM Do YYYY, h:mm:ss a.