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
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
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
@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.
I used a wrapper so I need not go down to this. You should just try.
I am new to this. can you please post an example for this?
Here's an example
https://gist.githubusercontent.com/xu2xulim/173367dafba6319dddc85d4404117462/raw/cd27e5efb908dd7220e841ab9607d556a76648a0/C27034c3.py
This is brilliant one liner perfectly suits for my need.
Thanks a lot @Felix
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
It looks like you're new here. Sign in or register to get started.