Is there any way to get the (current) user’s time zone setting on the Confluence Cloud REST API? I see there is a JavaScript API for that, but I can’t find anything in the REST endpoints.
How can I determine the user’s time zone via REST?
Thanks
Is there any way to get the (current) user’s time zone setting on the Confluence Cloud REST API? I see there is a JavaScript API for that, but I can’t find anything in the REST endpoints.
How can I determine the user’s time zone via REST?
Thanks
Hi @LukasGotter,
It used to be possible, but the capability was removed in an effort to improve privacy and conform to the requirements of GDPR. The decision is alluded to in Weekly GDPR API status development update - February 13th.
Regards,
Dugald
Hi @dmorrow - thanks for your response.
That is bad news. Then how are 3rd party apps supposed to sync the timezone with the Confluence user’s time zone? For example when displaying dates in a (static) macro.
To understand the topic better, could you explain how GDPR and the user’s time zone is connected? I’m able to get the user’s full name, email but not his time zone?
Many greetings
Lukas
Hi @LukasGotter,
I should have clarified that the GDPR project removed the ability for apps to get the user’s time zone through context parameters and when the request is being made as the app (if it was possible previously). With 3LO, the request is made using the user’s consent so it should be possible to get certain personal details. The Confluence getUser appears to return some personal details such as email
, but I don’t see time zone in the response. I do, however, see a timeZone
field being returned in the Jira getUser API. So to me this appears to be a feature gap, rather than something we would never be able to do. Maybe someone else knows about a Confluence REST API that returns timeZone
when called with the user’s consent (3LO)?
Regards,
Dugald
Hi Dugald @dmorrow,
thanks for explaining this further. To me it also seems this is a feature gap. Getting the user time zone via REST API and other settings such as language or date format is essential for macros to give a consistent user experience. Could you try to internally see if you have something planned and point us to that issue to watch it? Otherwise I would open a feature request for that.
Greetings
Lukas
I will try to get the Confluence team involved.
Hi @dmorrow,
any update on this? I’ve continued my investigations and it seems that all non-JavaScript options to get the user’s time zone and locale for Connect Apps have been deprecated:
com.atlassian.connect.spring.internal.AtlassianConnectContextModelAttributeProvider
has both timeZone and Locale set to deprecated and the values for atlassianConnectLocale
and atlassianConnectTimezone
are null. (They seem to come from the context parameters)Looks like the only option remaining is the JavaScript API AP.user.getTimeZone
. However, this approach will not work for static macros. Any suggestions?
Hi @LukasGotter, there is no update on this. It appears to be a feature gap, but we also need to be mindful about user privacy. Perhaps you could share your use case and in particular how your app intends to use the time zone information. This may help the Confluence team understand your needs further.
We have the ability in ScriptRunner to schedule scripts to run. We’d like to display the scheduled date/times using the user’s timezone (much like how Jira or Confluence displays dates in the users timezone) so they don’t need to do the datetime conversions themselves.
Hi @dmorrow - our use case for Meetical is, that we provide static macros which display date, time and other information about a meeting which comes originally from a (Google) Calendar and we store it in UTC. This information is then displayed (through the macros) on meeting minutes / meeting note pages. Of course, we want to format and display that information in the user’s time zone and based on other preferences like language and display formats (am/pm vs. 24hours), so that the user does not need to “translate” it from UTC or another time zone an format mentally on the fly. On Confluence Server this works well. Would be great if you can add such a REST Api to Confluence Cloud (again). Thanks for considering this!
Thanks @jbevan and @LukasGotter, I’ve pinged the Confluence Cloud Ecosystem team to ensure they are aware of this.
Is there any progress on this @dmorrow?
Not everyone works in UTC… very frustrating for our customers to work with dates in our forms app
Hi @sash011,
I believe the Confluence team are dependent on a platform team for this work.
It’s better to request for updates on the relevant issue (in this case CONFCLOUD-69670) since this approach will trigger notifications to those involved in the issue. I’ll do this for you now.
Regards,
Dugald
Thanks @dmorrow. I have commented there as well… Guys from Adaptavist ( @jbevan ) have reported this originally in 2018… [CONFCLOUD-61732] Return user's timezone via REST API - Create and track feature requests for Atlassian products.
Sad to see this is taking so long to get fixed
A complementary feature would be the ability to query the REST API with UTC datetimes. Currently, cql needs to be made in the local timezone of whom created the org at first, and returned results are in UTC. It’s quite inconsistent.