Skip to content

Instantly share code, notes, and snippets.

@iaindooley
Created April 10, 2020 05:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iaindooley/7ce6368af358207d488d2a48211fea12 to your computer and use it in GitHub Desktop.
Save iaindooley/7ce6368af358207d488d2a48211fea12 to your computer and use it in GitHub Desktop.
Link task cards
function linkTaskCards()
{
var board = new Trellinator().board("My Board");
var projects = board.list("Projects");
board.list("Tasks").cards().each(function(card)
{
try
{
var firstlabel = card.labels().first();
card.attachLink(
projects.cards().find(function(loop)
{
try
{
if(loop.labels().first().name() == firstlabel.name())
{
return loop;
}
}
catch(e)
{
return false;
}
}).first().link();
);
}
catch(e)
{
Notification.expectException(InvalidDataException,e);
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment