Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JIRA accountID Lenght is it always 25 chars?

Matt Hickman
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 20, 2022

Hi just building a script to pull out an accountID and then use that to remove the user from a group, I'm no coder so ended up using toString for the response and then substring to get out the accountID, I'm happy with that so long as the accountID's are always 25 chars long?

 

Thanks in advance

 

Matt

1 answer

1 vote
Mikael Sandberg
Community Champion
December 20, 2022

No, the Atlassian Id is not always 25 characters, it can be up to 128 characters. You should use the find users rest end point to get the Atlassian Id instead of relying on substrings.

Matt Hickman
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 21, 2022

Hi Mikael, 

 

I'm using:

 

'https://******.atlassian.net/rest/api/2/user/search?query=' + emailaddy
to get the accountID, but I need to filer out just the accountID, but can't find away in the API to just return the data I need.
Mikael Sandberg
Community Champion
December 21, 2022

Yeah, the search will return the full information, but you should be able to get the account Id by looking for the value of accountId. If you use substring look for the value between "accountId: " and , "accountType". If you are using smart values in an automation you should be able to find it using {{webResponse.body.accountId}} if you are using a web request to get the user.

Like Vamsi Kandala likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events