How do we get the account id for the app user?
I’ve updated ACJIRA-1686 with a link to the user picker rest api documentation
We have read it in dev env and it seems to be the same everywhere, including prod installation, as explained in the other thread (I hope I’m right).
Cheers,
Jack
Thanks @natashbar!!
I was referring to user search API
https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-api-2-user-search-get
Shoudl I update ticket https://ecosystem.atlassian.net/browse/ACJIRA-1686 so that account Type is reflected in User Picker and User Search endpoint or Do you recommend creating a separate ticket?
Thanks!!
Hi @jack
So you reckon it would be the same on dev and production environments in which case we could hard code it into the application.
Thanks
Paul
Atlassian confirmed earlier in this thread that the account ids for apps are the same as long as the app keys are the same.
Ok, thanks @danielwester
There are a few use cases that could benefit from more information provided (including account type), but my guess is (I’m not in a position to make that call) it cannot be added everywhere all at once.
Last time we internally discussed this, we only covered two of the most important cases (1- webhook body 2- user fetch API) to unblock developers from migrating to the new model. For any other use case a separate ticket needs to be created and each of them will be treated on their own merit. If you raise a new ticket, please also mention the use case and how it would impact your use case. It will help with justification and/or prioritization of the work.
Thanks,
Norman
Hi @paul
Exactly. This is what we did. Fingers crossed it will work in the same way on every single customer instance.
Cheers,
Jack
Thanks @natashbar
I have raised a separate ticket [ACJIRA-1729] - Ecosystem Jira to return account type in user Search API.
FYI: The ticket was created by cloning the issue ACJIRA-1686, so it automatically got assigned to Gabriel Magalhaes. I don’t have permissions to remove the assignee.
@natashbar Reading this topic and all related tickets along with developing an app for Jira I came to conclusion that accountType has not been neither confirmed or implemented for Jira webooks.
providing
“apiMigrations”; {
“gdpr”:true
}
in connect.json doesn’t change anything.
Summarizing:
- There isn’t accountType in webhooks - neither as headers or in request body / payload
- Webhook request still provides user_id and user_key in request (query) parameters
In theory March 28, 2019 no user_id or user_key will be provided and I still do not see any solution. This is quite a blocker.
ACJIRA-1674 is CLOSED but you can see in comments I am not the only one with such a problem.
The ACJIRA ticket has been reopened. Please watch the ticket for updates.
See [ACJIRA-1722] - Ecosystem Jira and [ACJIRA-1674] - Ecosystem Jira
@bkelley just closed those issues. accountType has been rolled out.
User accounid as the value when using Update Issue Custom Field.
How to get accountid:
https://[domain name].atlassian.net/rest/api/latest/user/search?query=[user email]
In the return string, which looks like this, you can spot the accountid:
[{“self”:“https://[domain name].atlassian.net/rest/api/2/user?accountId= 557058:1991c146-4646-43d3-98d0-xxx “,“key”:“admin”,“accountId”:” 557058:1991c146-4646-43d3-98d0-xxx “,“accountType”:“atlassian”,“name”:“admin”,“emailAddress”:”[user email]”,“avatarUrls”:{“48x48”:“https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:1991c146-4646-43d3-98d0-xxx/97b461af-8916-411e-a2a1-1f6e5e89adc7/128?size=48&s=48",“24x24”:“https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:1991c146-4646-43d3-98d0-4b72ee11f382/97b461af-8916-411e-a2a1-1f6e5e89adc7/128?size=24&s=24”,“16x16”:“https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:1991c146-4646-43d3-98d0-xxx/97b461af-8916-411e-a2a1-1f6e5e89adc7/128?size=16&s=16”,“32x32”:“https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:1991c146-4646-43d3-98d0-xxx/97b461af-8916-411e-a2a1-1f6e5e89adc7/128?size=32&s=32”},“displayName”:"user full name”,“active”:true,“timeZone”:“Europe/Berlin”,“locale”:“en_US”}]
Hi, could you advise the code about how to get accountId from the return string? I am using Scriptrunner post functions.
I’m fighting on this AccountId with a Jira v.8.5.5 (LTS) and using the API v2
- The route and param “/user/search?query=xxx” are not working with the error message “The username query parameter was not provided”.
- In the opposite way of this “/groupuserpicker?query=xxx” who works but doesn’t provide ‘AccountId’ (?).
- The route and param “/user/search?username=xxx” are working well also but still no ‘AccountId’ in the result (?).
So not possible to get this ‘AccountId’ field value on my environment, making impossible change on group assignment (for example, if I follow the doc…).
Can we have a restriction to get the field vaule? If not, what the hell is this?
RTFM rejection: I spend lot of time to read and apply the doc without real success but lot of issue. Thanks to do not drive me to the doc but instead only applicable info 
AccountId doesn’t exist on server/dc. Instead you’ll want to look at the userkey.
Thanks Daniel for your feedback but when I request change with the key provided I’ve issue:
{
"errorMessages": [
"Cannot add user. 'null' does not exist"
],
"errors": {}
}
I find nothing related to that in the doc or in the google’s history 
Is it a doc related to the version that I use?
In fact it’s a mess to find lot of docs but nothing applicable to my env without understanding the reason why.
Thanks in advance ad have a great week.
Ouff: JIRA 8.5.5
@GUILLAINSANCHEZ did you find that out? I’ve come to this dead end after trying exactly the same things you did.
These guys deprecated username everywhere and there’s no way to automate stuff not being able to link an email to an accountId 