RTC Required attributes for Condition applied for Custom Attributes
We are having the condition script below for some attributes "ASIL Level, Basket, Feature Area, Filed Against, Found In, Occurrence, Priority, Regions, Variant":
dojo.provide("com.example.mandatory");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
(function()
{
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
dojo.declare("com.example.mandatory", null,
{ matches: function(workItem, configuration)
{
var PA = workItem.getLabel(WorkItemAttributes.PROJECT_AREA);
var ST = workItem.getLabel(WorkItemAttributes.TYPE);
return (PA=="A" && ST=="Bug")|| (PA=="B" && ST=="Bug") || (PA=="C" && ST=="Bug"); }
}); })();
Now we need to add one more condition for project "A" (for all work item type) and apply for only "Brands"
How can we update in the same script?
Even i tried with the script below but it does not work :(
dojo.provide("com.example.gmvcu.mandatory");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
(function()
{
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
dojo.declare("com.example.gmvcu.mandatory", null,
{ matches: function(workItem, configuration)
{
var PA = workItem.getLabel(WorkItemAttributes.PROJECT_AREA);
var ST = workItem.getLabel(WorkItemAttributes.TYPE);
if (PA=="A" && ST=="Bug") {
return true;
} else if (PA=="B" && ST=="Bug") {
return true;
} else if (PA=="C" && ST=="Bug") {
return true;
} esle if (PA=="A") {
return true;
}
return false;
}
}); })();
Could you please help us? What should be the best solution? Should we update in the same script or create new? Thank you for your responses
2 answers
Hi Ralph Schoon
Thanks for your response
May be, I didn't frame the question properly . Sorry for that.
Below is my requirement:
Use case 1: Type=Bug, Project=X , make the attributes attr_1 & attr_2 as mandatory
Use case 2: Type = Bug, Project=Y, make the attributes attr_3 as mandatory
Is there a way to handle both these use cases via a single "Conditions" script instead of 2 separate scripts to avoid maintenance issues?
Comments
You have
- One condition that is either true or false
- A configuration of the condition mapping a set of attributes that are required if the condition is true
Can you have an attribute of the set being mandatory and one being optional?
Condition C, Attributes Aa, Ab
Condition C is true => Aa mandatory, Ab mandatory.
Or Attribute Aa mandatory => C = true, Ab optional => C=false is a contradiction.
That means no. That are my thoughts. Unless there is something else I am forgetting.
Condition C is true => Aa mandatory, Ab mandatory.
Or Attribute Aa mandatory => C = true, Ab optional => C=false is a contradiction.
That means no. That are my thoughts. Unless there is something else I am forgetting.
Comments
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Jul 24 '24, 7:37 a.m.Giang Le Thi Thuy
Jul 25 '24, 2:51 a.m.