Forums

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

Rest API for getting user ID

joe venuto June 29, 2023

Hello All 

I am trying to use the rest api 3 to get user account id but when I call it, it returns html about me being already logged in

Here is the first part of the output

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<title>You are already logged in - Central JIRA</title>
<meta name="application-name" content="JIRA" data-name="jira" data-version="8.20.15">

 

Ive tired with the following calls

https://[host]/rest/api/3/groupuserpicker?query=[user name]

https://[host]/rest/api/3/user/assignable/search?project=[project id]&query=[user email]

If I replace the 3 in the url with a 2 it returns a json response of the user but no account ID,  just the user key.

 

Ultimately I want to create an issue and assign it to a user but they require user account ID. Can I use the user  Key instead? 

JIRAUSERXXXXXX

2 answers

1 accepted

1 vote
Answer accepted
joe venuto June 29, 2023

I just need to assign users email {assignee: {name: [email]}}. I dont need to fetch account id

0 votes
joe venuto June 29, 2023

I can get user via https://[host]/jira/rest/api/2/user?username=[email] but account id is not returned just key

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events