How is the best way to tell if a user is a JSD customer or a Jira user from rest?

Hi team,

Is it ok and reliable to test the accountId of the user’s rest responses to tell if a user is a JSD customer or a Jira user?

image

If accountId = null, the user is a JSD customer, otherwise a full Jira user in Cloud with Atlassian credentials. Is there another more reliable way?

Cheers
Fernando

Hi Fernando,

JSD customer accounts will soon also have an accountId value, so checking for null won’t work much longer. What is your use case for needing to know the account type? In general it would be better to rely on application access or a permission check than the type of the account. In case of application access you will group JSD customer accounts and Atlassian accounts without application access on a site in the same bucket, which is in most cases the correct behaviour (most features of JSD treat the two the same).

Regards,
Michael

Hi @miruflin

I want to verify permissions in my connect app and deny access for “customer” accounts
Assuming I check for permissions via https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-permissions/#api-rest-api-3-mypermissions-get
How could I verify the user accessing my resources is a customer? JSM created customers have “BROWSE_PROJECTS” permissions, so this is not possible. Checking for “ADMINISTER_PROJECTS” permissions is too much, as no everyone in the company has this permission.

What else could I check to ensure this is a customer account?
We are checking for accountType in https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-users/#api-rest-api-3-user-get is this correct?

Thanks
Alex

Hi @sash011

If you want to know whether an account is a customer account (as opposed to an Atlassian account) then https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-users/#api-rest-api-3-user-get is the correct one to use. The “accountType” value in the response will either mention “customer” or “atlassian”.

A user can either have full access to a project (thus have access to the project in Jira), or only have access to the project in the customer portal. mypermissions operates under the assumption that the user could be in the portal, hence it returns “BROWSE_PROJECTS” in either case. Note that this is account type independent, as you could equally have an Atlassian account which only has portal access.

If you want to find out about a user’s permission in Jira terms only, then use https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-permissions/#api-rest-api-3-permissions-check-post to check for BROWSE_PROJECTS. This will only return results for users with full project access.