Hi, I am new to trellinator framework. I am trying to add a functionaity to my board.
I want a user different than trellinator to post a comment. This comment will be a number that we can call "x".
This comment will trigger a function that will copy the first "x" cards from list "A" to list "B".
So the use case will be...
1. User A post a comment with number "2".
2. The first "2" cards from list "A" will be copy to list "B"
Here I have some code I have been able to build.
function copyOnComment(notification)
{
var notif = new Notification(notification);
var A = new Trellinator().board("Board A").findOrCreateList("A");
var B = new Trellinator().board("Board B").findOrCreateList("B");
var x = 0;
if(notif.member().notTrellinator())
{
notif.board().list("A").cards().each(function(card)
{
x = x+1;
card.copyToList(B,1);
if(x>1)
exit();
});
}
}
Right now the copyToList function is not working. If I change the copyToList for a "post comment" it will stay on a loop and post comments on first two card list infinitely.
Any ideas on how to make this work?