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

How to get checklists from all the cards in a list?

Jigar Baraiya March 2, 2021

Hello,

I know the ID of a List which contains many cards. Is there any API for getting checklists from all the cards which are there in that one list?

 

Thanks,

Jigar

3 answers

1 accepted

2 votes
Answer accepted
Felix
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 2, 2021

You can grab all the checklists in one call by using something like this:

https://api.trello.com/1/lists/:idList/cards?fields=id&checklists=all&checklist_fields=name,id

Check out the nested resource documentation for the query params that might be useful.

Make sure you only include the fields you actually need, that'll ensure this call is fast.

Also, depending on how many cards/checklists you've got in the list, you may need to break it up into smaller batches, using a limit parameter, and before and/or since params, to paginate the cards in the list.

Finally, if you have more questions about the API or Trello development, the Developer Community is probably a better place for questions like this :)

Jigar Baraiya March 2, 2021

This is brilliant one liner perfectly suits for my need.

Thanks a lot @Felix 

milynnus
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.
March 3, 2021

@Jigar Baraiya 

Realised the equivalent of it using py-trello would be

client.fetch_json('/lists/' + '{idlist}' + '/cards', query_params=({'fields' : 'id', 'checklists' : 'all', 'checklist_fields' : 'name, id',}))

@Felix learned something

0 votes
Jigar Baraiya March 2, 2021

@milynnus 

Thanks for the response. So there is not short way other then iterate thru each card.

So I need to follow the steps:

1 . get the list of cards using https://api.trello.com/1/lists/5{listId}/cards?key=xxx&token=xxx

2. iterate thru each card and get the checklist using https://api.trello.com/1/cards/{cardId}/checklists/?key=xxx&token=xxx

Please let me know if any other approach is available for this.

milynnus
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.
March 2, 2021

@Jigar Baraiya 

I used a wrapper so I need not go down to this. You should just try. 

Jigar Baraiya March 2, 2021

I am new to this. can you please post an example for this?

milynnus
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.
March 2, 2021
0 votes
milynnus
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.
March 2, 2021

@Jigar Baraiya 

Definitely. You need to iterate through the cards on that list and get the checklist. just do a search you get the APIs.  

https://developer.atlassian.com/cloud/trello/rest/api-group-actions/#api-actions-id-get

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events