Forums

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

How can I list all projects the logged on user is working on with Jira REST API?

KerKla July 19, 2019

My question is how to list only projects, the currently logged on user (logged in with Jira REST API /auth/1/session POST Request) is working on. (The projects that contains issues they are assigned to.) I use the Jira REST API to request all other information I need.

I need to display only those projects so I can choose a project to e.g. log time on an issue it contains (so the user only gets those projects that are relevant in that case).

I already read a similar question about this (https://community.atlassian.com/t5/Answers-Developer-Questions/List-of-users-in-project-REST-API/qaq-p/536820) but this seems a little too much for what I want to achieve. As I want to use this in a mobile app, I try to limit requests to the minimum.
This article didn't provide a solution I could implement either (https://community.atlassian.com/t5/Answers-Developer-Questions/JIRA-Rest-API-Get-all-projects-filtered-by-Creator-Reporter/qaq-p/488815) which is why I decided to ask myself.

I am using Java and Retrofit for connecting with the API.

Is there a request or how can I access this information easily?
Thank you very much in advance!

2 answers

1 accepted

0 votes
Answer accepted
KerKla July 25, 2019

I ended up using a jql search

search?jql=assignee=currentuser()

 which responds with all issues the current user is assigned to - from there I can retrieve the projects the issues are belonging to and also, if required, limit fields according to my needs.

Thanks a lot for the help! :)

0 votes
Thomas Magny-Garcia
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.
July 19, 2019

Hi @KerKla ,

If you want to list the projects you have access (as user), I think "https://[YourURL]/rest/api/latest/issue/createmeta" should answer. Go to the projects list and only accessible projects are listed.

Hope it helps !

KerKla July 22, 2019

Hi!

Thanks, I tested it, but I still get all projects has access to not only the ones he is working on (allowed to track time on an issue in it, assigned to it, etc) which is what I want to have.

Is there another possibility?

Suggest an answer

Log in or Sign up to answer