Created
July 9, 2021 02:04
-
-
Save iaindooley/a3a05912a78e8ad895192bdc1eec3616 to your computer and use it in GitHub Desktop.
clearCustomFieldsAndCopyToNewBoard
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
var from_listname = "YOUR COMPLETED CARD LIST NAME";//update this with your actual list name | |
var to_boardname = "YOUR NEXT BOARD";//update this with the next board to move to | |
var to_listname = "YOUR NEXT LIST";//update this with the next list to move to | |
///////CODE GOES BELOW HERE////////// | |
var moved = new Notification(notification).movedCard(new RegExp("^"+RegExp.escape(from_listname)+".*","i")); | |
var copy = moved.copyToList(moved.currentList()); | |
copy.board().customFields().each(function(cf) | |
{ | |
console.log("NAME IS: "+cf.name()); | |
try | |
{ | |
copy.setCustomFieldValue(cf.name(),""); | |
} | |
catch(e) | |
{ | |
} | |
}); | |
copy.attachLink(moved.link()); | |
copy.moveToList( | |
new Trellinator() | |
.board(new RegExp(RegExp.escape(to_boardname),"i")) | |
.findOrCreateList( | |
new RegExp("^"+RegExp.escape(to_listname)+".*","i") | |
) | |
,"top" | |
); | |
moved.archive(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment