Skip to content

Instantly share code, notes, and snippets.

@iaindooley
Created August 30, 2019 10:54
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/77bb232c6a04f52bf3e39b186a7fec41 to your computer and use it in GitHub Desktop.
Save iaindooley/77bb232c6a04f52bf3e39b186a7fec41 to your computer and use it in GitHub Desktop.
Set labels and due date when description changed
function setLabelsAndDueDateWhenDescriptionChanged(notification)
{
var edited = new Notification(notification).changedCardDescription();
var split = edited.description().split("\n");
new IterableCollection(split).each(function(line)
{
var pair = line.split(":");
if(pair[0].trim().toLowerCase() == "Feature 1")
edited.addLabel("Some Label");
else if(pair[0].trim().toLowerCase() == "Some Date")
edited.setDue(new Date(pair[1]));
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment