How to get the AccountID for Customer Accounts in JSM

Still need help?

The Atlassian Community is here for you.

Ask the community

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

View Profile Page

Jira usually associates a user to a Profile, but that doesn't work when the account is a portal-only customer type. However, you can still get the AccountID using the Customer page.

  1. Go to your Jira Service Management Project
  2. Select Customers
  3. Hover over the user you want the accountID, and click the View Profile button.
  4. Even though the page might show an error message, you can still get the accountID in the URL. (see screenshot)

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.

  1. Find an issue ticket the desired user is associated with
    1. 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
  2. Search for the field this user is associated with. (e.g., Reporter, Request Participants, etc.)
  3. 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.

  1. Open the endpoint below in a new tab and change the information accordingly:
  2. 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
  3. 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:

Last modified on Sep 12, 2023

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.