It's all about the answers!

Ask a question

Not getting "Tag" values into the browser/Eclipse


Anurag Patel (2110) | asked Jun 14 '16, 3:46 a.m.
 Hello all,

I am trying to access the "Tag" value in below program.

------------------------------------------------------------------------------------------------------------------------------------

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

(function() {
var HttpConnectorParameters= com.ibm.team.workitem.api.common.connectors.HttpConnectorParameters;
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;

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

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

        var tags= workItem.getValue(WorkItemAttributes.TAGS);
        var params= new com.ibm.team.workitem.api.common.connectors.HttpConnectorParameters();
        params.url= "http://www.w3schools.com/xml/cd_catalog.xml";
        params.xpath= "//CD";
        params.columnXpaths= ["./ARTIST"];
        params.columnIds= ["ARTIST"];

        var connector= context.getDataConnector("HttpConnector");
        var values= connector.get(params);
        console.log("Tags :: "+tags);
        var result= [];
        while(values.hasNext()){
            var entry= values.next();
            var title= entry.getById("ARTIST");
            if (title.indexOf(filter) > -1) {
                result.push(title);
            }
        }

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

--------------------------------------------------------------------------------------------------------------------------------

I created a value set with provider "Script based value set" and this value set I assign to the attribute in workitem.
When I run the wor kitem in browser then it is not showing the alert message and when I run this script in eclipse then it is not showing the values in eclipse console.

I can able to access the "tag" value using getValue function and able to see it in console also.
Can any one know what will be the issue.

One answer



permanent link
Donald Nong (14.4k213) | answered Jun 14 '16, 10:16 p.m.
It seems that you describe the issue in a wrong way - it appears that you have problems with using the console.log() function, not accessing the TAGS attribute. Even you have a null value, the console.log() function should still output the constant string, such as "Tags :: " in your code.

The console.log() function will output in the web console (developer tool) of a browser, or the .log file of the Eclipse client.

Your answer


Register or to post your answer.