Forums

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

Using Rest API, how do I get all issues (open, closed) from a Kanban board?

Amy Russell February 7, 2018

I can easily get all open issues from the Kanban board with "https://<mycompany>.atlassian.net/rest/agile/1.0/board/<boardid>/issue", but I can not pull the closed issues. I have done it successfully with the Scrum board, where I get all issues back, open or closed. I am not sure why, but for Kanban, it seems that the API only pushes back open issues. Suggestions?

Thanks!

2 answers

1 accepted

1 vote
Answer accepted
Warren
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.
February 7, 2018

Hi Amy

I just tried the /issue call on a Kanban board of mine and it returned closed items, but I have these closed items showing on the Kanban board. The API call you're using is saying "show me everything that's on the board". Do you have all these closed items showing on your board? If not, I suspect your board filter is possibly excluding them, in which case you'd need to do as Domagoj said and pass in a ?jql= where you're negating what's in the board filter to exclude closed items. I hope that makes sense. If not, show us what your board filter is and we can tweak it for you

Amy Russell February 7, 2018

Thanks, Warren, for your response. No, we do not display our closed items, (actually I mean the "Done" issues), on our Kanban board. Evenually there would be hundreds and that would not display well :)

 

I am trying Domagoj's solution, but I have not done this before. Can you let me know if I am constructing this correctly? Here is my API call:

"https://<mycompany>.atlassian.net/jira/rest/api/2/issues/search?jql=project%20%3D%20&lt;<myproject>&gt;"

 

It doesn't work though--am I forming it improperly? Should it be a JIRA.com address instead?

Warren
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.
February 7, 2018

Please note the call that you're using is incorrect, it shouldn't have the /jira or the /issues - see my call further down

You need to see what your board filter is, but assuming it's just for the one project, I would imagine it looks something like

project=<myproject> AND status!=Done

so that it excludes the Done items.

What you want in the ?jql part is then just the first bit, so

https://<mycompany>.atlassian.net/rest/api/2/search?jql=project=<myproject>

where <myproject> is the 2, 3 or 4 letters before the issue number (e.g. a project called Digital Development Team would have issues DDT-232 and DDT-4568, so you would use DDT in that instance)

Amy Russell February 7, 2018

Yes, sorry, I added the /issue at the last minute when I was trying to troubleshoot:

https://<mycompany>.atlassian.net/rest/api/2/search?jql=project=DMR actually works now! Thank you both for your help! I am so glad I joined the Atlassian community today--it saved me so much time!!

Balaji
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 4, 2018

Hi, this is working fine. but i can get maxresults as 50. how can i get all records?

李冲 August 23, 2018

I also met this issue. can someone please help on this? how to get all records? thanks.

Warren
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 23, 2018

Hi

You need to perform multiple requests to get all the data. To do this you need to use the maxResults and startAt parameters, so the first call would be

https://<mycompany>.atlassian.net/rest/api/2/search?jql=project=DMR&maxResults=100&startAt=0

then the next call would be

https://<mycompany>.atlassian.net/rest/api/2/search?jql=project=DMR&maxResults=100&startAt=101

and keep going. There is a returned field called total which is the total number of records available.

So you could get returned values of startAt=0, maxResults=100, total=225 which means you would need to do the call 3 times (1-100, 101-200, 201-225).

The highest that maxResults can be is 100, this is a setting in Jira. It used to be 1000, but Atlassian reduced it last year (but that's another story!)

1 vote
Domagoj Zecevic
Contributor
February 7, 2018

What about searching issues with jql?

Something like this

http://www.example.com/jira/rest/api/2/search?jql=...
Amy Russell February 7, 2018

Thanks for your answer, Domagoj. I am trying to figure out how to form the url for the search, as you suggested.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events