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

Pagination doesn't work for archived cards

Максим Туев June 6, 2019

Hi

I try get archived cards in list via method lists/{id}/cards by page, and when I invoke request for second page (using before or after parameter) I receive empty list.

Request example: https://api.trello.com/1/lists/5c57185a81c955613303e220/cards?fields=all&checklists=all&actions=commentCard&filter=closed&limit=200&before=5c3c919af6b88b855f7e801b

When I use this logic for opened cards (parameter filter=open instead of filter=closed) all is well.

Any help would be much appreciated

 

2 answers

1 accepted

1 vote
Answer accepted
matt
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 12, 2019

Huh, yeah that is unfortunately confusing. In the case of archived cards, using the id of the card as a since or before param will lead to incorrect results, because the id of the card isn't the ordering for the endpoint. Instead you should use an ISO timestamp for since/before and Trello will return cards that have been archived either before or since the date that you provide.

 

For example: since=2019-04-18T17:34:52.887Z

bentley
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 12, 2019

Another way to get at the same information would be to filter for the updateCard actions in the board:

1/boards/:idBoard/actions?filter=updateCard&limit=1000

And then look for "closed": true in the data key.

When paging through the actions, the action ID is the time at which the event occurred (as opposed to the card ID which is when the card was created) and may be a bit more intuitive.

Максим Туев June 14, 2019

Thank you!

0 votes
Garrett
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 12, 2019

Hey @Максим Туев 

We took a closer look at this and we were able to reproduce the issue here. Currently, the before and since parameters are not working on the /lists/id/cards route when the filter=closed param is included.

We've submitted this bug report internally, and we'll work to get that resolved as soon as possible. I unfortunately can't give an ETA on that, but as soon as a fix is ready, we'll deploy it.

Thanks for bringing this to our attention!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events