Requesting list of assignable users returns 400 or 404

Valeriy Novytskyy October 7, 2015

Hello,

I use rest API to request a list of assignable users for a JIRA project (identified by "issue key"):

GET http://<jiraserver>/api/2/user/assignable/search?issueKey=<project> HTTP/1.1
Accept: application/json
Authorization: Basic <key>
Accept-Encoding: gzip,deflate
Host: btjira
Connection: Keep-Alive

 

This returns 404 not found. Also tried:

GET http://<jiraserver>/api/latest/user/assignable/search?issueKey=<project> HTTP/1.1
Accept: application/json
Authorization: Basic <key>
Accept-Encoding: gzip,deflate
Host: btjira
Connection: Keep-Alive

 This returns 400 with no explanation offered.

I tried this using an actual issue name for issueKey, and just the key (which is project name).

How do I make it return assignable users?

3 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
V N October 13, 2015

The "Get" URL does not have escaped characters any longer, now I am getting 404, but with explanation: "The issue no longer exists". Request and response are below. What does this mean? Thanks.

Request:

GET http://servername/rest/api/latest/user/assignable/search?issueKey=projectname HTTP/1.1

Accept: application/json

Authorization: Basic Z3RvY3Npc2E6Z1QwIS1jUzFzM3J2SWMz

Accept-Encoding: gzip,deflate

Host: servername

Connection: Keep-Alive 

Response:

HTTP/1.1 404 Not Found

Server: Apache-Coyote/1.1

X-AREQUESTID: 883x280604x2

X-ASESSIONID: 15mk157

X-ASEN: SEN-2013202

X-Seraph-LoginReason: OK

X-AUSERNAME: username

Cache-Control: no-cache, no-store, no-transform

Vary: User-Agent

X-Content-Type-Options: nosniff

Content-Type: application/json;charset=UTF-8

Date: Tue, 13 Oct 2015 21:43:01 GMT

Content-Length: 61

 {"errorMessages":["The issue no longer exists."],"errors":{}}  

 

 Why is it expecting "issueKey" when I want to get assignable users for the whole project, not an individual issue? I also tried "projectKey" instead of "issueKey" and I get 400 again, and the message is:

 

{"errorMessages":["No project or issue key was provided"],"errors":{}}

 

Why doesn't this work?

Volodymyr Krupach
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 13, 2015

That because there is no issue "projectname". Probably you should pass either correct issue key: ?issueKey=ISSUE-1 or search by project: ?project=projectkey

0 votes
Valeriy Novytskyy October 12, 2015

Hello,

After adding the \rest prefix I continue to receive 400 error.

Request:

GET http://servername/rest/api/latest/user%2fassignable%2fsearch?issueKey=projectname HTTP/1.1
Accept: application/json
Authorization: Basic keyhere
Accept-Encoding: gzip,deflate
Host: servername
Connection: Keep-Alive

Response:

HTTP/1.1 400 Bad Request
Server: Apache-Coyote/1.1
Content-Length: 0
Date: Tue, 13 Oct 2015 00:22:27 GMT
Connection: close

What is wrong with the request?

 

Volodymyr Krupach
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 12, 2015
0 votes
Volodymyr Krupach
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 7, 2015

Hi Valeriy!

You missed "rest" prefix:

http://<jiraserver>/rest/api/2/user/assignable/search

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events