Skip to content

Instantly share code, notes, and snippets.

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/a3a05912a78e8ad895192bdc1eec3616 to your computer and use it in GitHub Desktop.
Save iaindooley/a3a05912a78e8ad895192bdc1eec3616 to your computer and use it in GitHub Desktop.
clearCustomFieldsAndCopyToNewBoard
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