Skip to content

Instantly share code, notes, and snippets.

@iaindooley
Created February 13, 2019 02:47
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/d1ffa01f7f20d8a30dbbd2524392cf00 to your computer and use it in GitHub Desktop.
Save iaindooley/d1ffa01f7f20d8a30dbbd2524392cf00 to your computer and use it in GitHub Desktop.
Total custom field
function updateCustomFieldTotal(notification)
{
var card = new Notification(notification).updatedCustomField("My Field");
if(parts = /(.+) \(([0-9]+)\)/.exec(card.currentList().name()))
{
new_count = parseInto(parts[2])+parseInt(card.customFieldValue("My Field"));
card.currentList().setName(parts[1]+" ("+new_count+")");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment