Multiple dependent attributes in RTC value set
Hi all,
I am trying to create dependent attributes in RTC value set. It is possible to fetch the values from a XML file to a field. Depending upon the value in the field we can populate its dependent value from the Xml file into another field. This can be done using HTTP filter value set using appropriate X-path expression .
I want to have similar use case but multiple values to be selected in a field and then the dependent values should be populated in the another field. The values should be from the xml file. I have tried using HTTP filter but I am not getting the appropriate X-path expression. Can this be done using script based value set or X-path expression? if possible please guide on it.
I am missing something.
Below is the code:
dojo.provide("org.example.workitems.providers.ProjectAutoModel");
dojo.require("com.ibm.team.workitem.api.common.connectors.HttpConnectorParameters");
(function() {
var HttpConnectorParameters= com.ibm.team.workitem.api.common.connectors.HttpConnectorParameters;
dojo.declare("org.example.workitems.providers.ProjectAutoModel", null, {
getFilteredValueSet: function(attributeId, workItem, context, filter) {
var params= new HttpConnectorParameters();
params.url= "https://xyz.com/ext/WorkItemXML/RCN.xml";
params.columnXpaths= ["./name"];
params.columnIds= ["CoreSRD"];
alert("in function!!");
var connector= context.getDataConnector("HttpConnector");
var values= connector.get(params);
var result= [];
while(values.hasNext()){
var entry= values.next();
var modelControl= entry.getById("CoreSRD");
if (modelControl.indexOf(filter) > -1) {
result.push(CoreSRD);
}
}
return result;
}
});
})();
Regards,
Deepali Nigade
One answer
A script-based value set should be quite easy to implement. Here is an example.
https://jazz.net/forum/questions/182739/script-based-dependent-list-shows-as-retrieving-for-ever
(in this example, "listb" depends on "lista")
Since in your case the attribute is multi-valued, you may consider using the "contains" operator rather than "equal to" in the conditions.
https://jazz.net/forum/questions/182739/script-based-dependent-list-shows-as-retrieving-for-ever
(in this example, "listb" depends on "lista")
Since in your case the attribute is multi-valued, you may consider using the "contains" operator rather than "equal to" in the conditions.