It's all about the answers!

Ask a question

work item type is same on different work items


Pankaj Sharma (40335) | asked Aug 05 '15, 11:50 a.m.
 I am using RTC 5.0
I want to access the work item type for respective work item using javascript.
I have a requirement to display data based on workitem type, I used the following script

dojo.provide("com.example.ValueProvider_projectautopopulate1234");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");


(function() {
    dojo.declare("com.example.ValueProvider_projectautopopulate1234", null, {


        getValue: function(attribute, workItem, configuration) {

var WorkItemAttributes = com.ibm.team.workitem.api.common.WorkItemAttributes;
var Wtype = workItem.getLabel(WorkItemAttributes.TYPE);
var attr4_value = '';

if(Wtype = 'Release')
{

attr4_value = 'yes';

}
else
{
attr4_value = 'no';
}

return attr4_value;
        }
    });
})();

But i am getting workitem type as 'Release' even if I am on different workitem, Please help

2 answers



permanent link
Rosa Naranjo (2.9k11421) | answered Aug 06 '15, 11:08 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
i would suggest you look at some of the blogs about the RTC plain java client API such as https://rsjazz.wordpress.com/2013/03/20/understanding-and-using-the-rtc-java-client-api/

and on our jazz.net library such as https://jazz.net/library/article/1229

permanent link
Ralph Schoon (57.1k23642) | answered Aug 06 '15, 11:18 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Aug 06 '15, 11:19 a.m.
Please do this workshop:
Process Enactment Workshop for the Rational solution for Collaborative Lifecycle Management

Lab 5 is around JavaScript. Most likely your code is basically wrong and because JavaScript and the editor in RTC is so underwhelming in helping developers you need to do the work a compiler and debugger would do for you otherwise.

Tips: Try "StateID" and ==, carefully read https://jazz.net/wiki/bin/view/Main/AttributeCustomization and get some basics in JavaScript here http://www.w3schools.com/js/ . Use Console.log() to print the values and use this to debug your script: Debugging attribute customization scripts - an example

Your answer


Register or to post your answer.