It's all about the answers!

Ask a question

Can we call OSLC URI from Attribute Customisation(Script based value set) and retrieve the value ?


Shwetha G (5019) | asked Dec 15 '16, 12:56 a.m.
Hello All,

Currently I have an Oslc URL, Is there any way I can use the attribute customization techniques like script based value set to retrieve the values ?

Please assist me on this. I see we can use the URLs in the scripts.

One answer



permanent link
Ralph Schoon (58.4k23642) | answered Dec 15 '16, 2:00 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Comments
Shwetha G commented Dec 15 '16, 8:27 a.m. | edited Sep 04 '17, 3:01 p.m.

Hello Ralph,

Here is the script that i tried to customize according to my requirement, but no value is returned to the combo box.

Could you please suggest me if anything has gone wrong or i need to add something more..

dojo.provide("org.example.workitems.providers.TracksCountValueSet");
dojo.require("com.ibm.team.workitem.api.common.connectors.HttpConnectorParameters");

(function() {

dojo.declare("org.example.workitems.providers.TracksCountValueSet", null, {

    getFilteredValueSet: function(attributeId, workItem, context, filter) {

        var params= new com.ibm.team.workitem.api.common.connectors.HttpConnectorParameters();
        params.url= "https://localhost:9443/ccm/oslc/workitems/52/oslc_cm:tracksWorkItem";
        params.xpath= "//*[name()='oslc_cm:Collection']";
        params.useOAuth = true;
      

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

        var result= [];
        while(values.hasNext()){
            var entry= values.next();
             result.push(entry);
          
        }

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

Thank you.


Shwetha G commented Dec 15 '16, 8:28 a.m.

 I really thank you for the details. I tried it :)  however i could not customise to my requirement. I have posted it below...

could you please suggest me on that


Ralph Schoon commented Dec 15 '16, 8:37 a.m. | edited Dec 15 '16, 9:07 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I am sorry, but I don't have time to debug other people scripts. You can try to debug your scripts e.g. with the Chrome or Firefox development tools. First I would make sure that the values provided in the script work in the HTTP filtered value set.

PS: we recently found out that this will be very slow for large amount of input data as it has to be loaded several times.

Your answer


Register or to post your answer.