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

Not getting "Tag" values into the browser/Eclipse

 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.

0 votes



One answer

Permanent link
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.

0 votes

Your answer

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
× 10,940

Question asked: Jun 14 '16, 3:46 a.m.

Question was seen: 2,016 times

Last updated: Jun 14 '16, 10:16 p.m.

Confirmation Cancel Confirm