Context

A JavaScript module which provides functions for the current product context.

Methods

getToken (callback)

Retrieves the current user context as a JWT token containing details such as space key, issue id, etc. Throws an error if add-on does not support JWT authentication

Parameters

NameTypeDescription
callback

function

the callback that handles the response

Returns

[ 'Promise' ].<string>

A promise that contains the token

Example

1
2
3
AP.context.getToken(function(token){
  console.log("JWT token string", token);
});

getContext (callback)

Retrieves the current user context containing details such as space key, issue id, etc.

Parameters

NameTypeDescription
callback

function

the callback that handles the response

Returns

[ 'Promise' ].<Object>

A promise that contains the context

Example

1
2
3
4
5
AP.context.getContext(function(response){
  console.log("Jira Issue Key", response.issue_key);
  console.log("Confluence page id", response.pageId);
  console.log("license status", response.license);
});