Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

...

App configuration: tab "Rules"

All samples below have to be entered into the text field on tab "Rules". These rules will be executed automatically for all traffic light fields.

...

Set traffic-light "Criticality" of inward/outward linked issue(s) to current issue's "Criticality"

Info

// Having multiple linked target issues, the last update will overwrite prior settings of the linked source issue:

var myCriticality = issue.trafficLight("Criticality");
issue.inward("relates to", function(linkIssue) {
    if (linkIssue.trafficLight("Criticality") != myCriticality) linkIssue.trafficLight("Criticality", myCriticality);
});

Depending on the link direction, you can use issue.inward() or alternatively issue.outward() for the opposite link direction. The first parameter is the issue link type's direction name. Here: "relates to" is used, which is the same for both link directions whereas inward:"is blocked by" and outward:"blocks" in case of the issue link type "Blocks".

Get value of 2 fields (system field or custom field by names) and set traffic-light based on comparison of both field values


Info

var field1_name = "Technical Knowledge";
var field1_index = trafficLight.systemfields.map(function(field) { return field.name }).indexOf(field1_name);
var field1_value = (field1_index > -1 ? issue[trafficLight.systemfields[field1_index].id] : "");
console.log("user defined rule: retrieve value of field '"+ field1_name + "' = " + field1_value);

var field2_name = "Developing";
var field2_index = trafficLight.systemfields.map(function(field) { return field.name }).indexOf(field2_name);
var field2_value = (field2_index > -1 ? issue[trafficLight.systemfields[field2_index].id] : "");
console.log("user defined rule: retrieve value of field '"+ field2_name + "' = " + field2_value);

if (field1_value < field2_value) issue.trafficLight("Usability", "(,,red) red");

...