Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

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?

0 votes


Be the first one to answer this question!

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 11,043

Question asked: Dec 19 '16, 3:28 a.m.

Question was seen: 2,189 times

Last updated: Dec 19 '16, 3:28 a.m.

Confirmation Cancel Confirm