Skip to main content
Skip table of contents

GET_ACCOUNT_ID_BY_MAIL

The GET_ACCOUNT_ID_BY_MAIL function converts an email address extracted from a JSON data source into an Atlassian accountID. It uses a JSONPath expression to locate the email in your data, and then queries the Atlassian system to return the corresponding accountID.

Usable in: Value Fields

Syntax: { GET_ACCOUNT_ID_BY_MAIL(( PARAM_1 PARAM_2 )) }

Parameter

Type

Examples

Description

PARAM_1

string

$.email

The JSONPath expression that returns an email that should be converted into an accountID

PARAM_2

Optional string

'atlassian'

Optional value that allows to filter by account type of a user. Possible values are 'atlassian' or 'customer'

Note: The “PARAM_2” parameter was introduced to address scenarios where multiple accounts may share the same email address. By default, the function returns the first account that matches the search criteria. In the event that several accounts exist, please enter PARAM_2 to ensure that the function selects the correct account type.

Value Field Example

Assume the following example JSON data source:

CODE
{
  "name": "Mario",
  "email": "test@test.com"
}

Basic Conversion:
Convert the email to an accountID without specifying an account type will return the first match:

CODE
{ GET_ACCOUNT_ID_BY_MAIL(( $.email )) }

Returns an accountID, for example, '12345678910'.

Filter for an Atlassian account:

Use the GET_ACCOUNT_ID_BY_MAIL in combination with the 'atlassian' filter to convert the email to an accountID with the account type being atlassian.

CODE
{ GET_ACCOUNT_ID_BY_MAIL(( $.email 'atlassian' )) }

Returns the accountID associated with the Atlassian account type, for example, '12345678910'.

User Picker Usage

The GET_ACCOUNT_ID_BY_MAIL function is commonly used in combination with a dependent field targeting a native Jira user picker field. In order to set the value of the user picker field, the accountID is required, which may not be readily available in your data source. This function helps you convert existing emails to the required accountID, making it easier to set the value of the user picker field.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.