Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

User Account ID

I am getting all users account IDs through JIRA API. But for some users, JIRA is returning abnormal account id like qm:ee2833d7-282a-4f2d-83eb-71b47af58c76:08637147-f905-4c32-a05d-59438b9a4235. Please help me figure out the reason

1 answer

0 votes
Prince Nyeche Community Leader Feb 10, 2021

Hi @hmnaqvi 

Welcome to community! That user will be a customer only user. The reason for that is because you have Jira Service Management application and that too has its own user base. What you should do is filter the accountType from the API. when calling Jira users, specify as:

"accountType": "atlassian" 

To return only Jira users.

Hi @Prince Nyeche 

Thank you for your response.

But I want to get account ids for customers too. For most of the users, it's working fine. But for some newly created users, it's returning that long string. Putting the account type filter will omit these users from the result set, which I don't want. Please advise

Prince Nyeche Community Leader Feb 10, 2021

Hey @hmnaqvi  based on your question, you wanted to know why you got the <qm:code>. With that fact, you only have one option. Either you filter it or get everything. So it can't be for some users its working fine and other it's not. It doesn't seem logically that way. You definitely have customer only users on your instance.  If you do not want those type of users,  simply filter it. 

Hey @Prince Nyeche 

Filtering isn't a choice here. Have to get it for all users. But my point is that account ids should have a similar pattern like an alphanumeric string that we usually get in return. But for the newly created users, that is not the case. Problem is that I'm using external data for jira app. Through this, I'm getting company information from an external db. Also, I have a utility scheduled that gets account ids from Jira and puts them in an external db. When jira api returns that qm:code for a user, that utility saves that in the external db. But when external data for jira tries to get company information on issue/request creation having account id in where clause, it sends alphanumeric string for that user instead of the qm:code. That is creating the issue. Please advise.

Prince Nyeche Community Leader Feb 10, 2021

Hey @hmnaqvi I think there's a confusion here. The <qm:code> is a different kind of accountId specifically to "customer only users" on Jira Service Management. Now the other type "5ab599xxxxx" - this is accountId for any other Atlassian cloud user. You need to know that these two users are distinctively different and can't be related to one another as the same user type. My question to you now is, what type of users are you expecting and on what application is the user info used to query on issues with your app? This will give me an idea of what you're trying to achieve and what advice I can give.

Hi @Prince Nyeche 

This is not exactly true because I'm getting qm:code in return from API for an agent on jira service management. That user isn't a customer but an agent on JSM. Also, for most of the customer only accounts, I'm getting the normal code but for some newly created users (customers and agents) I'm getting the qm:code account id. 

I'm trying to get account ids for all the users (customers+agents) on JSM. This was working fine but recently, when we added some new users on JSM, the api is returning qm:code instead of the account id. 

Prince Nyeche Community Leader Feb 10, 2021

Hi @hmnaqvi 

Now this is the part that might get confusing when it comes to cloud. So I'm going to expand on it.

This is not exactly true because I'm getting qm:code in return from API for an agent on jira service management. That user isn't a customer but an agent on JSM. 

If you're getting a JSM agent as <qm:code> the only logical explanation is that you have a duplicated user on your system. The same email address is being used as a customer user and a Jira user. This will cause a confusion because on Jira, customer user takes priority over Jira user when the same email address is used to reference the same user. If you doubt this, perform a user search within your Jira and see if you see a duplicated user with the same email, check your Jira user base and JSM user base. You will need to perform a migrate to Atlassian account from your JSM base to merge the customer user to Atlassian user.

I'm getting the normal code but for some newly created users (customers and agents) I'm getting the qm:code account id. 

This is the expected behaviour when you create a customer only account, Jira associates the accountType to value "customer". Hence that's why you get <qm:code> as the returning accountId. So you shouldn't expect anything else other than that.

I'm trying to get account ids for all the users (customers+agents) on JSM. This was working fine but recently, when we added some new users on JSM, the api is returning qm:code instead of the account id. 

I don't know how you configured your users before but as long as I can remember, customer users has always had <qm:code>. And if you were getting customer users with "5ab599xxxxx" - accountId most probably you created those users as Jira users without giving them application access, that's the only logical conclusion.

From what I can deduce, you're just realising this part as a problem now and most probably have not been using it in the right way. So I'll advice you to take a step back and review your users (customers + agents) and try to determine if everything said above explains what you're experiencing now. In summary, what you're getting is expected if they are customer only, they should return <qm:code> as accountId and if they are Jira user they should return "5ab599xxxxx" - accountId.

Let me know if you come to the same conclusion after reviewing your user base.

Hi @Prince Nyeche 

I am currently searching for users from this Directory link and getting only one entry for a user who's id is returned as qm:code. And this user is also an agent on JSM. Can you please let me know is there any other place from where I can check Jira User Base and JSM user base.

image.png

Hi @Prince Nyeche 

I think you are right. Administrator before me have added customer only users to jira and didn't gave them JSM rights. So they were able to access the portal for creating requests. He should have added them through inside the project to customer only role. And for users for which I am getting a qm:code, I have removed one user (who is an agent too) from the customer only group. Now I am going to retrieve its ID and let you know. It should return the agent account ID instead of the qm:code.

Hi @Prince Nyeche 

Although, I had removed 2 such users' duplicate ids from customers only but still getting two entries from the api. Can you please confirm how much time it takes to reflect changes.

API reply:

[{"self":"https://engro.atlassian.net/rest/api/3/user?accountId=qm:ee2833d7-282a-4f2d-83eb-71b47af58c76:15f67ea1-6322-48d7-a102-4a4419532b7f","accountId":"qm:ee2833d7-282a-4f2d-83eb-71b47af58c76:15f67ea1-6322-48d7-a102-4a4419532b7f","accountType":"customer","emailAddress":"xxx@engro.com","avatarUrls":{"48x48":"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/default-avatar.png","24x24":"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/default-avatar.png","16x16":"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/default-avatar.png","32x32":"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/default-avatar.png"},"displayName":"Saqib Akbar","active":true,"timeZone":"Asia/Karachi","locale":"en_US"},{"self":"https://engro.atlassian.net/rest/api/3/user?accountId=5f8fcf3f06c34300699fc278","accountId":"5f8fcf3f06c34300699fc278","accountType":"atlassian","emailAddress":"xxx@engro.com","avatarUrls":{"48x48":"https://secure.gravatar.com/avatar/bb08d50ea08db0586fbaa0cb9b97e599?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FSA-0.png","24x24":"https://secure.gravatar.com/avatar/bb08d50ea08db0586fbaa0cb9b97e599?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FSA-0.png","16x16":"https://secure.gravatar.com/avatar/bb08d50ea08db0586fbaa0cb9b97e599?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FSA-0.png","32x32":"https://secure.gravatar.com/avatar/bb08d50ea08db0586fbaa0cb9b97e599?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FSA-0.png"},"displayName":"Saqib Akbar","active":true,"timeZone":"Asia/Karachi","locale":"en_US"}]
Prince Nyeche Community Leader Feb 11, 2021

Hi @hmnaqvi 

Removing users on cloud, doesn't mean that the user will be removed completely. Atlassian uses a directory that ensures integrity between users base. So what it does is make the user not visible on the UI, however behind the scene that same user is just inactive. This helps to re-associate a user in case you happen to re-invite the user. So in your situation, you will need to go here on your instance https://engro.atlassian.net/admin/jira-service-desk/portal-only-customers search for such user and just select "Migrate to Atlassian account". Note

When you migrate a user, the account is transferred with their requests to the Atlassian account and give them a new key. Their portal-only account can't be unmigrated or reactivated.

Once you've done that, you will simple have an accountId as "5a19bxxx" accountype for the user.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
Community showcase
Published in Jira Service Management

Why upgrade to Jira Service Management Premium?

We often have questions from folks using Jira Service Management about the benefits to using Premium. Check out this video to learn how you can unlock even more value in our Premium plan.  &nb...

196 views 1 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you