User

A JavaScript module which provides functions to interact with the user currently in session.

Methods

getCurrentUser (callback)

This method retrieves the current user object containing the user's Atlassian Account ID.

Parameters

NameTypeDescription
callback

function

the callback that handles the response. A single parameter is passed to the callback. This parameter is an object comprising an attribute "atlassianAccountId" and an attribute "accountType" which could be atlassian for a regular Atlassian user account or customer for a Jira Service Desk account representing an external service desk user.

Example

1
2
3
AP.user.getCurrentUser(function(user) {
  console.log("The Atlassian Account ID is", user.atlassianAccountId);
});

getTimeZone (callback)

Retrieve the current user's timezone. If there is no logged in user, the server timezone is returned.

Please be aware that this field is under profile visibility controls and that a user may intend to hide this field from the public. Because this API will provide unrestricted access to the current user's timezone you should only use this API to establish context for the user. You should not present the user's timezone in a way that can be seen by other users viewing the application.

Parameters

NameTypeDescription
callback

function

the callback that handles the response

Example

1
2
3
AP.user.getTimeZone(function(timezone){
  alert(timezone);
});

getLocale (callback)

Retrieve the user's locale used by the product.

Please be aware that this field is under profile visibility controls and that a user may intend to hide this field from the public. Because this API will provide unrestricted access to the current user's locale you should only use this API to establish context for the user. You should not present the user's locale in a way that can be seen by other users viewing the application.

Parameters

NameTypeDescription
callback

function

the callback that handles the response

Example

1
2
3
AP.user.getLocale(function(locale){
  alert(locale);
});

Rate this page: