What to change in the below script to add "State" condition
Hi,
In workitems, the below script makes a field mandatory if priority=medium. What changes needs to be done to add a condition that, the field should become mandatory only if "state=Assigned" and "priority=medium":
dojo.provide("org.example.workitems.providers.Priority");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
(function() {
var WorkItemAttributes = com.ibm.team.workitem.api.common.WorkItemAttributes;
dojo.declare("org.example.workitems.providers.Priority", null, {
matches: function(workItem, configuration) {
var sev = workItem.getValue(WorkItemAttributes.PRIORITY);
return (sev === "priority.literal.l3"); // Medium
}
});
})();