It's all about the answers!

Ask a question

Attribute Customisation:Script basedvalue Set using Javascript for Mutliple values as Columnids


vinitha dsouza (147223136) | asked Dec 19 '16, 3:28 a.m.
Hello Team,

I used Provider as "HTTP Filtered Value Set" with below configuration,
URL: https://xxx.com:9443/ccm/oslc/contexts/_D4CKIMJyEeSJxvvhbOuJ2A/workitems?oslc_cm.query=dc:type="com.rtc.configuration.workitemtype.type.delivery" &oslc_cm.properties=dc:identifier,dc:title
rowxpath="//Collection/ChangeRequest";
columnxpath="./title|./Identifier";
columnids="summary|id";
label format=${0}:${1}

Results comes: M.2.4: 10201

Same i am trying using the Scriptbased value set (Javascript).But not sure how to get the both the values,

dojo.provide("net.example.scripted.oslc.wiids.ValueSetProvider");

dojo.require("com.ibm.team.workitem.api.common.connectors.HttpConnectorParameters");

(function() {
    dojo.declare("net.example.scripted.oslc.wiids.ValueSetProvider", null, {

        getValueSet: function(attributeId, workItem, context){

        var params= new com.ibm.team.workitem.api.common.connectors.HttpConnectorParameters();
        params.url="https://xxxx.com:9443/ccm/oslc/contexts/_D4CKIMJyEeSJxvvhbOuJ2A/workitems?oslc_cm.query=dc:type=%22com.rtc.configuration.workitemtype.type.delivery%22&oslc_cm.properties=dc:identifier,dc:title";
        params.xpath="//Collection/ChangeRequest";
        params.columnXpaths=["./identifier|./title"];
        params.columnIds=["deliveryNo|deliverySum"];
        params.ignoreInvalidCertificates=true;
        params.useOAuth=true;

        var connector= context.getDataConnector("HttpConnector");
        var values= connector.get(params);
        var result= [];

        while(values.hasNext()){
            var entry= values.next();
            var wid= entry.getById("deliveryno");  ===> This only works if column id is only ONE not for the above         
            var wsummary=entry.getById("deliverySum")

            //Concat both wid + wsummary and assign to wid
            result.push(wid);
        }

        return result;
    }
   });
})();


Can you let me know how to fetch the multiple values in the Reponse?

Be the first one to answer this question!


Register or to post 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.