help with copying card from one board to another
See original GitHub issueI am not a Python expert and trying to learn and trying to use py-trello. Thank you for writing the library!
Would like to copy a card from one board to a list in a different board. Have selected the source_board, target_board and target_list using the functions available in py-trello. Unable to copy the card though.
Now py-trello already has code for moving a card.
def change_board(self, board_id, list_id=None):
args = {'value': board_id}
if list_id is not None:
args['idList'] = list_id
self.client.fetch_json(
'/cards/' + self.id + '/idBoard',
http_method='PUT',
post_args=args)
I can tell that the answer lies on this Trello API page in terms of how the url is to be formed that needs to go to the Trello API, but honestly am not clear as to what the parameters should be if say I want to copy everything that can be copied in a card - attachments, checklists, labels, comments and description.
Also, even if the url format were to be clear to me, I am not sure how to create a function to copy the card by modifying the change_board function above. Not sure of how to augment the class in my code 😦
Thank you for your help.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (1 by maintainers)
Top GitHub Comments
hi @mals14, it’s better to ask this kind of questions in stackoverflow. but you can use this method i wrote for copying cards https://github.com/SahandAkbarzadeh/trello-chicbot/blob/master/lib_trello/trello_extensions.py
And thank you for sharing your method. It worked beautifully, and it has given me pointers as to how to use code from within a Python library.