Created
August 30, 2019 10:54
-
-
Save iaindooley/77bb232c6a04f52bf3e39b186a7fec41 to your computer and use it in GitHub Desktop.
Set labels and due date when description changed
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 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