Hi Guys,
How to get the timezone of the Connected User? In fact, I'm getting the value of the Date/Time CustomField related to the timeZone of the Server, what I need is the value related to the timezone of the connected user. Could you please help?
For more details, kindly, check my last comment in https://answers.atlassian.com/questions/324977/get-datetime-customfield-value?page=1#comment-325305
Thanks,
Rosy
I cannot give you absolutely correct answer, but most possible, you should get user using
https://docs.atlassian.com/jira/6.2.1/com/atlassian/jira/user/util/UserUtil.html
and then either check the user property or user preference (I have idea that it is the second)
https://docs.atlassian.com/jira/6.2.7/com/atlassian/jira/user/UserPropertyManager.html
https://docs.atlassian.com/jira/6.2.7/com/atlassian/jira/user/preferences/UserPreferencesManager.html
Thanks Alexey for the tip !
I got it using the following code:
ExtendedPreferences extPref = userPreferencesManager.getExtendedPreferences(authenticationContext.getUser());
log.debug("timeZone: " + extPref.getString(PreferenceKeys.USER_TIMEZONE));
Many thanks,
Hi Rosy, Did you get t api to get Date/Time field value related to the timezone of the connected user. If yes, can you please share it.
Hello Sreenivas P, No I didn't find it. If you check my latest comment here, you will see how I resolved it! Regards, Rosy
For anyone looking this up as I was. Use the
authenticationContext.getLoggedInUser()
instead of
authenticationContext.getUser()
It looks like you're new here. Sign in or register to get started.