How to get the AccountID for Customer Accounts in JSM
Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.
Sometimes, we need to perform ticket actions using the user's accountID (e.g., Mention a User in comments using Automation for Jira or Add a Request Participant to an issue ticket, etc.). Still, this information is not displayed in the User Management pages when it's related to a portal-only customer account.
This article will show a few ways to obtain the AccountID from a Portal-only customer account.
Customers Page
JQL Search Results
Since the changes in JQL search, Jira now uses the accountID instead of the email when searching for fields with the User Picker type. You can take advantage of this by clicking on one of the links in the "Open requests" or "Closed requests" columns, which will redirect to the issue navigator, where you can get the accountID from the JQL syntax. (see screenshots)
Customer Service Management feature
Using the new customer service management feature, you can see a "profile" of your customer account; there, you can get the accountID in the URL address bar.
Reference: Introducing rich customer context in Jira Service Management
REST APIs
Using the JIRA Issue API Endpoint
You can rely on the Jira issue API to get the accountID for a portal-only customer account if they're added to the ticket as a Reporter, Request Participant, or any custom field that has a User Picker field type and this user is associated with it.
- Find an issue ticket the desired user is associated with
- Open the issue using the URL format below:
https://<instanceName>.atlassian.net/rest/api/2/issue/<issue-key>?expand=names e.g. https://myinstance.atlassian.net/rest/api/2/issue/SD-123?expand=names
- Open the issue using the URL format below:
- Search for the field this user is associated with. (e.g., Reporter, Request Participants, etc.)
- Its struct will be similar to the JSON below:
"reporter": { "self": "https://myinstance.atlassian.net/rest/api/2/user?accountId=qm:5fa6aad4-3a95-44f9-b50d-a465c5d85172:225adc9a-ce45-45a4-92de-3c2d8b6b687f", "accountId": "qm:5fa6aad4-3a95-44f9-b50d-a465c5d85172:225adc9a-ce45-45a4-92de-3c2d8b6b687f", "avatarUrls": { "48x48": "...", "24x24": "...", "16x16": "...", "32x32": "..." }, "displayName": "Customer Name", "active": true, "timeZone": "...", "accountType": "customer" },
Using the JIRA User Search API Endpoint
You can search for users using this endpoint if unsure about an issue ticket related to the desired user.
- Open the endpoint below in a new tab and change the information accordingly:
https://<instancename>.atlassian.net/rest/api/3/user/search?query=<emailAddress> e.g. https://myinstance.atlassian.net/rest/api/3/user/search?query=customer@company.net
- Its struct will be similar to the JSON below:
[ { "self": "https://myinstance.atlassian.net/rest/api/3/user?accountId=qm:5fa6aad4-3a95-44f9-b50d-a465c5d85172:225adc9a-ce45-45a4-92de-3c2d8b6b687f", "accountId": "qm:5fa6aad4-3a95-44f9-b50d-a465c5d85172:225adc9a-ce45-45a4-92de-3c2d8b6b687f", "accountType": "customer", "emailAddress": "customer@company.net", "avatarUrls": {...}, "displayName": "Customer Name", "active": true, "timeZone": "...", "locale": "en_US" } ]
Reference: Jira Cloud platform / REST API v3 (beta) / Find users
Administration - User Management
You can also get the accountID of an internal user/portal-only customer account when exporting the customer list in a CSV file. Find the instructions in the articles below:
Here are a couple of articles that you can use the accountID: