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.

Syntax
userAccountId(userName) #Output: Text
Examples
Parser expressionDescription
%{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

ParameterInput (data type)Description
userName

TEXT

Text containing a valid user display name.
Output

This function returns a TEXT


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.

Syntax
userAccountId(userList) #Output: Text list
Examples
Parser expressionDescription
%{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 accountId "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

ParameterInput (data type)Description
userList

TEXT LIST

Any valid text list containing user display names.
Output

This function returns a TEXT LIST


Use cases and examples