Created
April 10, 2020 05:52
-
-
Save iaindooley/7ce6368af358207d488d2a48211fea12 to your computer and use it in GitHub Desktop.
Link task cards
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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