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/97adc91a07451576cbc62bbf523611ab to your computer and use it in GitHub Desktop.
Save iaindooley/97adc91a07451576cbc62bbf523611ab to your computer and use it in GitHub Desktop.
Set job number
function setJobNumber(notification)
{
var notif = new Notification(notification);
var created = notif.createdCard();
var numbers = notif.board().cards().find(function(card)
{
if(parts = /.* #([0-9]+)/.exec(card.name()))
{
return parseInt(parts[1]);
}
else
{
return 0;
}
}).asArray();
numbers.sort();
created.setName(created.name()+" #"+(numbers.pop()+1));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment