How to find projects associated to a particular user

learn jira April 13, 2017
I have to list all projects a user associated to in JIRA ( in which he can create an issue) as a drop down in my application. Is there a way to find that?.
 
Currently the following steps is what I am doing to get it done.
1. Making call to - https://jira.xxx.com/jira/rest/api/2/project
2. From the project lists got as response from #1 for each of those projectKey making a call to below api with  
https://jira.xxx.com/jira/rest/api/2/user/assignable/search?project=XXX
3. if the response for #2 contains the logged in user then it will be shown in drop down.
 
Is this the correct way or is there a better approach for the same.
Thanks in advance
 
 

1 answer

1 vote
Sam Hall
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.
April 21, 2017

You could use: GET /rest/api/2/issue/createmeta

For example, if you make a GET request to:

https://{your-jira-url}/rest/api/2/issue/createmeta

You should get a list of the projects in which the user has permission to create issues.

Sam Hall
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.
April 21, 2017

This assumes that:

  • the user logs into your application.
    and  
  • your application makes the request using the user's credentials.
Like Dominique Delforge likes this
Mark August 22, 2018

If I am the JIRA admin, how can I make the REST request as a particular user and get back the result?

Suggest an answer

Log in or Sign up to answer