Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to get issues assigned to an user using JIRA Rest API ?

ravi May 18, 2015

I am working on an iOS mobile app and like to get issues assigned to a particular user and i am currently using the below rest api 's,

1.https://help.myDomain.com/rest/api/2/search?jql=assignee=%@

2.https://help.myDomain.com/rest/api/2/search?jql=assignee=currentuser()

but i am only getting the issues assigned to a user only for a particular project , Can any one let me know the rest api which will get the issues from all the projects assigned to a user rather than a single project ?

Thanks

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

2 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.
May 18, 2015

https://help.myDomain.com/rest/api/2/search?jql=assignee=currentuser()

Returns issues from all project since your JQL does not include any project specific conditions.

Maybe your user is assigned only in one project and that's why you get issues from this project.

El fallahi Moncef February 16, 2018

Please help me on this.

Search for JIRA Issue that the current user has the right to see.

Thanks.

0 votes
ravi May 18, 2015

Hi @Volodymyr Krupach

Thanks for answering my question , but i am using this -"https://help.myDomain.com/rest/api/2/search?jql=assignee=currentuser()"  but still i am getting only the issues from a single project but the user is the team lead for several projects where he has to see issues from different projects , can you let me know how can i add JQL tothis api for getting projects as well.

Thanks

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.
May 18, 2015

Hi ravi, Please try to put "assignee=currentuser()" into to Advanced search box (instructions if you need them https://confluence.atlassian.com/display/JIRA/Advanced+Searching). I an sure that it will show you the same results as you get through the REST. So the problem is in data. If you clearly see that the current user is Assignee in issues in different projects and can work with these issues, please try to launch reindex (JQL works upon index): https://confluence.atlassian.com/display/JIRA/Search+Indexing

Like Sean Batt likes this
ravi May 19, 2015

Hi, Thanks for your time and answer, Can you please let me know why would i need to perform a re-index as all the issues shown with the API are assigned to a current user . What will change if i perform a re-index ?

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.
May 19, 2015

JQL works on top of JIRA index. If it's broken JQL returns wrong results.

ravi May 19, 2015

Got it thanks i got the solution to my problem , Can you let me what filter do i need to add at the end of this API "https://help.myDomain.com/rest/api/2/search?jql=assignee=currentuser()"; to get results ordered by latest date and it will solve my problem.

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.
May 19, 2015

To order by issue creation date in descending order please use following JQL: "https://help.myDomain.com/rest/api/2/search?jql=assignee=currentuser() order by createdDate desc"

ravi May 21, 2015

Hi @Volodymyr Krupach i appreciate your help for the answer , can you put "order by createdDate desc" in rest api form please post the URL, i am unavailable to get the order right.

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.
May 21, 2015
Shrikant Maheshwari November 14, 2017

@Volodymyr Krupach

can i get the number of issues assigned to different uses of a particualr project, basically i want to group by the result is it feasible using JQL as i want to trigger the email for the same.

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.
November 15, 2017

Hi @Shrikant Maheshwari,

There is no "group by" in JQL. Instead you can:

1) make separate REST calls for each user:
https://help.myDomain.com/rest/api/2/search?jql=assignee=user1 AND project = DEMO

If you are not interested in issues and only in total number you can pass maxResults=0. Please check the docs:
https://docs.atlassian.com/jira/REST/cloud/#api/2/search-search

 

2) or get all data at once (assuming that there is no paging):
https://help.myDomain.com/rest/api/2/search?jql=project = DEMO order by assignee
and iterate through returned issues checking the assignee.

TAGS
AUG Leaders

Atlassian Community Events