Created
June 17, 2020 12:23
-
-
Save iaindooley/97adc91a07451576cbc62bbf523611ab to your computer and use it in GitHub Desktop.
Set job number
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 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