Extract AccountId in Customer Portal

Hello developers,

We have some problems with the JSD Customer Portal.
Is there a way to extract the AtlassianAccountId for the currentLoggedInUser from within an Iframe?
The context of the Iframe does not provide the currentUserId.

I have tried several things in the browser console (after switching to my iframe) which returned “undefined”:

AP.user.getCurrentUser(function (location){console.log(location)})
AP.user.getUser(function (location){console.log(location)})
AP.getUser(function (location){console.log(location)})
AP.getCurrentUser(function (location){console.log(location)})

Is it possible to make the ID available in the IFrame?
Any advice is much appreciated.

Thank you in advance,

​Björn

Hi, you can use /myself endpoint

Hi, can you share a bit more details ? I am facing the same issue .

AP.request({ url: ‘/rest/api/2/myself’} ).then(console.log) returns current user, payload contains accountId

1 Like