Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Can't add members through Create Card via API when using idCardSource

I'm creating cards via API. When I add the idCardSource (using another card as a template) the field idMembers is ignored. If I just remove the idCardSource from the query parameters, the idMembers field is considered and the members are added to the card. Someone has faced the same situation?

2 answers

0 votes
Jonathan Marin November 22, 2023

Hey Paulo,
You should take a look at the keepFromSource parameter and remove members from it. It worked for me.

0 votes
Vishaal S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 1, 2023

Hi Paulo,

Welcome to the Atlassian community!

Unfortunately, Trello API does not have a separate endpoint for adding members to a card during card creation. Instead, you need to add the members to the card after it has been created, by updating the card's idMembers property.

Here is an example cURL request to update a card and add members to it:

curl -X PUT https://api.trello.com/1/cards/<card_id> \
-d key=<your_api_key> \
-d token=<your_token> \
-d idMembers=<member_id_1>,<member_id_2>,...

We also have an active developer community, so if you have any questions about setting this up, I'd recommend reaching out there: https://community.developer.atlassian.com/c/trello/42

 

Cheers,
Vishaal S | The Trello Team

First, thank you for the answer Vishaal!
I was not trying to add members to the card using a separate endpoint, I was using the parameter "idMembers" of the "Create Card" endpoint (https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-post-request).

When I input a list of members (idMembers) without inputting a template card (idCardSource), all works fine and the members are added to the card.

Example:

https://api.trello.com/1/cards?idList={ID_LIST}&key={KEY}&token={TOKEN}&due={DUE_DATE}&idMembers=ID_MEMBER1,ID_MEMBER2&name={NAME}

But, when I send both "idMembers" and "idCardSource", the members are not added to the card.

Example:
https://api.trello.com/1/cards?idList={ID_LIST}&key={KEY}&token={TOKEN}&idCardSource={ID_CARD_TEMPLATE}&due={DUE_DATE}&idMembers=ID_MEMBER1,ID_MEMBER2&name={NAME}

Vishaal S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 5, 2023

Ah! Ideally, that should work based on the card templates as well, For a question like this and a potential workaround, Trello's Developer Community is really your best bet: https://community.developer.atlassian.com/c/trello/42

API experts and Trello Developer Advocates are there, and they'll be best able to answer your questions.

Perfect! I will follow there!
Thank you again Vishaal!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events