Class: AvatarClient

AvatarClient(jiraClient)

new AvatarClient(jiraClient)

Used to access Jira REST endpoints in '/rest/api/2/avatar'

Parameters:
Name Type Description
jiraClient JiraClient
Source:

Methods

createTemporaryAvatar(opts, callbackopt) → {Promise}

Creates a temporary avatar. This function doesn't seem to work the way the Jira API describes, so for now just don't use it.

Parameters:
Name Type Attributes Description
opts

The options to be used in the API request.

Properties
Name Type Description
avatarType

The avatar type. May be 'project' or 'user'.

avatarFilename

The name of the file being uploaded

avatarFileSize

The size of the file

avatarFilePath

The path to the avatar file.

callback <optional>

Called when the avatar is created.

Source:
Returns:

Resolved when the avatar is created.

Type
Promise

cropTemporaryAvatar(opts, callbackopt) → {Promise}

Updates the cropping instructions of the temporary avatar. This function doesn't seem to work the way the Jira API describes, so for now just don't use it.

Parameters:
Name Type Attributes Description
opts Object

The options to be used in the API request.

Properties
Name Type Description
avatarType string

The avatar type. May be 'project' or 'user'.

crop Object

See https://docs.atlassian.com/jira/REST/latest/#d2e3316

callback <optional>

Called when the avatar has been cropped.

Source:
Returns:

Resolved when the avatar has been cropped.

Type
Promise

getAvatars(opts, callbackopt) → {Promise}

Returns all system avatars of the given type.

Parameters:
Name Type Attributes Description
opts

The options to be used in the API request.

Properties
Name Type Description
avatarType

The avatar type. May be 'project' or 'user'.

callback <optional>

Called when the avatars are retrieved.

Source:
Returns:

Resolved when the avatars are retrieved.

Type
Promise