It's all about the answers!

Ask a question

calculated value script to read work item subscribers - rational-team-concert


Monika Gupta (6144) | asked Apr 05 '13, 5:54 a.m.
edited Apr 05 '13, 6:00 a.m. by Ralph Schoon (63.1k33646)

I wrote a calculated value script to read the value of subscribers and autopopulate a custom attribute (of type string).
The aim was to include the custom attribute in the query output.
======================================
dojo.provide("org.example.workitems.providers.CalculatedSubscribers");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
(function() {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
dojo.declare("org.example.workitems.providers.CalculatedSubscribers", null, {
    getValue: function(attributeId, workItem, configuration) {
       return workItem.getValue(WorkItemAttributes.SUBSCRIPTIONS)
    }
});
})();
======================================
This script does not work. The custom attribute comes blank
-- Is the script correct? Is it possible to "getValues" of "subscriptions" like this?
-- Am I missing upon some steps here? I already included the "subscribedby" attribute as a "dependency" in the custom attribute.

One answer



permanent link
Ralph Schoon (63.1k33646) | answered Apr 05 '13, 6:06 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Apr 05 '13, 6:07 a.m.
Hi Monika,

you can find the valid attribute ID's for RTC here: https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Accessing_built_in_attributes_of

As you will notice there is no API WorkItemAttributes.SUBSCRIPTIONS which is basically because subscriptions are not at all managed as an attribute. It is not accessible in Java Script. Similarly inaccessible are approvals, work item links, attachments and the like.

Also see https://jazz.net/library/article/1093 Lab 5 for what you can and can not do in scripts.

If you want to access the items mentioned above you need to use the JavaAPI and would probably have to create an Extension.

Your answer


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