Cause of {"errorMessages":[],"errors":{}} with /rest/api/2/user/assignable/search? string

PR July 30, 2020

Hi community members,

When I send the below API call,

https://company.url/jira/rest/api/2/user/assignable/search?project={{projectkey}}

I get an error 

{"errorMessages":["No project with the provided key exists"],"errors":{}}

Please advise where the problem source could be. The vendor - which supplies the third party JIRA app integration from the ticketing system - believes it is on the JIRA side and JIRA admins think it could be on the vendor side. 

Additional info:

1.  JIRA hosted on an in-company server though named company.cloud; no atlassian.net domain URL, no vanity URL etc.,

2. Basic Authentication with username/password.

3. Whitelisting of all IPs done.

Your thoughts and ideas are really welcome.

PR

1 answer

0 votes
Michael Raj July 31, 2020

Hi @PR ,

Did you check your project key at /rest/api/2/project?

And try this in web browser (e.g. Firefox), it's easier to read this way.

 

Best,

Michael

PR July 31, 2020

Hi Michael,

Yes, when I use the jira/rest/api/2/project, the project key does appear. it is only when I use /api/2/user/assignable/search?project={{projectkey}} that the error occurs.

David Bakkers
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.
August 1, 2020

What is the purpose of the "/jira" or the "/user/assignable/" within your search URL?

To search for something, it's just plain "/rest/api/2/search", as in:

https://{company.url}/rest/api/2/search?project={projectkey}

 

PR August 3, 2020

Hi David, 

The third party tool, Freshdesk, uses this REST API call to populate the field called Assignee in their widget for JIRA integration. The problem is that we are not able to assign to any users or JIRA developers from this dropdown list on the JIRA widget.

David Bakkers
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.
August 3, 2020

Here's how to test if the URL is valid:

  1. Open a web browser and login to Jira
  2. In the same browser, open a new tab
  3. Paste the complete URL into the tab's URL
  4. If it's valid, you'll get a properly formatted JSON response from the REST API
  5. If it's invalid, the REST API will say so and the fault is with the third party tool

Here's a test URL you can use on Atlassian's public Jira instance, as a proof of the method.

This works:

https://jira.atlassian.com/rest/api/2/search?project=BAM

 This does not work:

https://jira.atlassian.com/rest/api/2/user/assignable/search?project=BAM

But there is no error. I probably have no rights to get that information.

PR August 3, 2020

Well, I have been using the browser only to test out the URLs. I do get a json response file with the URL you have indicated, but get the error message while using the

rest/api/2/user/assignable/search?project=WBB

string in the URL. The third party vendor insists that this URL has to return a  response and there is nothing they can do on their side. I am grappling to understand what it is that needs fixing on JIRA side, as I too believe that the tool has to change but they do not think so. I need more info to justify which URL that they should use to look for a list of assignable users against a project.

David Bakkers
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.
August 3, 2020

Well, that might be as far as I can help. When I do test against Atlassian's own Jira, it works.

If I try the following:

https://jira.atlassian.com/rest/api/2/user/assignable/search

I get the expected error "No project or issue key was provided".

If I try with an invalid project key BATTY, like this;

https://jira.atlassian.com/rest/api/2/user/assignable/search?project=BATTY

I get the expected response "No project with the provided key exists"

If I try with a valid project key BAM, like this:

https://jira.atlassian.com/rest/api/2/user/assignable/search?project=BAM

I get no error, but I get no results either. This is probably because Atlassian won't let me return a list of their users, which makes sense as the REST API documentation says "This resource cannot be accessed anonymously"

When I try the following query against my own Jira Cloud instance, it works fine too:

https://{private}.atlassian.net/rest/api/2/user/assignable/search?project=BPT

This returns a list of assignable users for the project with the key BPT.

If I provide an invalid project key BATTY, I get the error "No project with the provided key exists" as expected.

So, if the error the tool is getting is "No project with the provided key exists" then the fault is with the tool's REST API call, as it contains an invalid project key.

If there is no error, but no results returned, the fault is still with the tool, as it's not properly authenticated to lookup the list of users.

Anything else, then I'd say you might have a bug due to the type of Jira you're using (IE Jira SERVER vs Jira CLOUD) or the version of Jira. I'd suggest you raise a bug ticket with Atlassian to have it investigated a bit further.

PR August 4, 2020

Thank you David for all the details and research. Appreciate your help. I will check with the vendor and Atlassian, per your suggestion, to identify a solution for my issue. 

Priya

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events