In the following URL, It is enough to create a new card with multiple members by assigning a array whose element is the ID of members by strings.
https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-post
---------------------------
idMembers
Array<string>
Comma-separated list of member IDs to add to the card
---------------------------
But, I can't create new card in this way, and the error is {"message":"Invalid objectId","error":"ERROR"} .
How can I create ? It is helpful to show a sample code to do this.
My code is as follows:
var payload =
{"key": "XXXXXXXXXXXXXXXXXXXXXX",
"token": "XXXXXXXXXXXXXXXXXXXXXX",
"idList" : "XXXXXXXXXXXXXXXXXXXXXX",
"name" : "aaa",
"idMembers": ["Mr. aaa","Mr. bbb"],
var option =
{"method":"POST",
"payload":payload
};
UrlFetchApp.fetch(URL,option);
@[deleted] the idMembers needs to be a comma separated list of member IDs, not member names or usernames.
Here's an example written in Trellinator:
https://gist.github.com/iaindooley/20925ee9690aae643ad473622d1ff608
Here's the implementation of Card.create:
https://github.com/iaindooley/trellinator-libs/blob/master/Card.js#L1628
You can read more about Trellinator here:
You can also try the above code snippet here:
Thank you for your answer.
I have retried in the following way by referring URL above:
var payload =
{"key": "XXXXXXXXXXXXXXXXXXXXXX",
"token": "XXXXXXXXXXXXXXXXXXXXXX",
"idList" : "XXXXXXXXXXXXXXXXXXXXXX",
"name" : "aaa",
"idMembers": "Mr. aaa's ID,Mr. bbb's ID", // not array
var option =
{"method":"POST",
"payload":payload
};
UrlFetchApp.fetch(URL,option);
In this way, no error has occurred and I can get the result what I wanted.
Very thank you !!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.