userAccount()

User name

This function returns the Atlassian account ID for a given user display name or email address. In case the given text is not a valid display name (or email address) of a user, an empty text is returned. In case multiple users have the same display name/email address, the first one is returned.

userAccountId(userName) #Output: Text

Examples

Parser expression

Description

%{userAccountId("Bob Smith")}

This example returns the Atlassian account ID of the user Bob Smith, e.g.:

557058:145e0983-5707-439c-80e4-1160dd57f142

%{userAccountId("Will Smith")}

Assume, we have two users with the same name "Will Smith", the first with the Atlassian account ID "557069:145e0983-5707-439c-80e4-1160dd57f142", the second with "77cb4ae0e4b97ab11a18e99f5". Then the result would be

557069:145e0983-5707-439c-80e4-1160dd57f142, reflecting that the account ID of the first "Will Smith" is returned.

%{userAccountId("B.Smith@mydomain.com")}

This example returns the Atlassian account ID of the user with the email address B.Smith@mydomain.com, e.g.:

557058:145e0983-5707-439c-80e4-1160dd57f142

%{userAccountId("Smith")}

This example returns the Atlassian account ID of the first user whose name or email address includes Smith.

Additional information

Parameters used in this function

Parameter

Input (data type)

Description

userName

TEXT

Text containing a valid user display name.

Output

This function returns a TEXT


User list

Variant for multiple users. In case one of the given texts is not a valid display name of a user, an empty text is returned. In case multiple users have the same display name for an element of the list, the first one is returned.

userAccountId(userList) #Output: Text

Examples

Parser expression

Description

%{userAccountId(toStringList(%{issue.cf10021}))}

This example returns the Atlassian account ID of all users which are stored in the given custom text field (e.g. "John Doe, Mary Jones, Bob Smith").

To achieve this, the following functions are used:

%{userAccountId(["Bob Smith", "Dolly Jones"])}

This example returns the Atlassian account ID of the given two users, e.g.:

557058:145e0983-5707-439c-80e4-1160dd57f142, 5cb4ae0e4b97ab11a18e00c7

%{userAccountId(["Will Smith", "Dolly Jones"])}

Assume, we have two users with the same name "Will Smith", the first with the Atlassian account ID "557069:145e0983-5707-439c-80e4-1160dd57f142", the second with "77cb4ae0e4b97ab11a18e99f5". Dolly Jones has the account ID "5cb4ae0e4b97ab11a18e00c7". Then the result would be

557069:145e0983-5707-439c-80e4-1160dd57f142, 5cb4ae0e4b97ab11a18e00c7, reflecting that the account ID of the first "Will Smith" is returned.

Additional information

Parameters used in this function

Parameter

Input (data type)

Description

userList

TEXT

Any valid text list containing user display names.

Output

This function returns a TEXT

📚 Use cases and examples

Use case JWT feature Label Parser functions Use case description Workflow function
Send an email to the project lead for a system managed in Jira Service Management Assets

(cog) 


getNameFromAsset()

getAttributeFromAsset()

userDisplayName()

In our Jira Service Management project, we want to automatically send an email to the project manager to inform him of an incident in a system managed asset. 

Send email