Abstract
This code snippet fetches the current user time zone.
Logic
Fetch the Time zone component of Jira and create a Calendar instance with this time zone.
Snippet
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.timezone.TimeZoneManager // access timeZone of current user def userTimeZone = getComponent(TimeZoneManager).getLoggedInUserTimeZone() c1 = GregorianCalendar.getInstance(userTimeZone);
Placeholders
NA
Examples
The outcome of the code snippet is a calendar instance with current user time zone which you could use to set a field to the current user time zone.
References
- getComponent()
- Groovy Documentation
Related articles