It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Pagination doesn't work for archived cards Edited

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 Jun 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 Jun 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.

0 votes
Garrett Atlassian Team Jun 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
Community showcase
Published in Trello

Develop a new Habit during Lockdown

If you had to thrive a new habit during a lockdown, what would it be? Trello

1,499 views 12 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you