I want to dynamically make an attribute required when another attribute is null using conditions
![]()
I am trying to make a work item attribute required when another attribute has no value. I have tried many different ways to return the null value but haven't had any luck. I am a student and new to RTC, any help would be appreciated. I have provided the code I am using below. Thank you in advance!
dojo.provide("org.example.workitems.providers.newAttributeCondition"); dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes"); var WorkItemAttributes = com.ibm.team.workitem.api.common.WorkItemAttributes; dojo.declare("org.example.workitems.providers.newAttributeCondition", null, { matches: function(attributeID, workItem, configuration) { var RCAppID= (workItem.getValue("newAttribute") //newAttribute is the attributeID return (RCAppID !=== null) //if id newAttribute is not null, attribute is required } }); })(); |
One answer
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.
Comments
I have updated my script to this with still no avail:
dojo.provide("org.example.workitems.providers.SubTeamRequired")
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.SubTeamRequired", null, {
matches: function(workItem, configuration) {
var subTeam= (workItem.getValue("rootCauseApp"));
var result = subTeam !=== "";
return result;
}
});
})();