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

Calculated Field Javascript Help

Greetings,

I am currently trying to create a calculated field that displays a number value/calculation of two other fields entered into a workitem.

To start I am simply trying to access the value of one of the fields using the following code:


dojo.provide("com.example.ValueProvider");
(function() {
dojo.declare("com.example.ValueProvider", null, {

getValue: function(attribute, workItem, configuration) {
var test_stringAttribute = workItem.getValue("com.ibm.team.workitem.attribute.hrs");
var hours = Number(test_stringAttribute);
return hours;

}
});
})();


The Custom Field is "com.ibm.team.workitem.attribute.hrs" and I am trying to display this in a read only field on the work item.

I have created a Calculate Value entry in the Attribute Customization area of my Project Area using the above code in a Javascript File. The necessary permissions have been enabled along with the necessary dependencies.

Could anyone provide me with some guidance or the location of a basic step by step tutorial. All of the examples on the jazz wiki assume I have extensive knowledge of deploying the actual scripts.

Thank you so much for any help you may have.

Regards,

Paul

0 votes



2 answers

Permanent link
Hi Paul,

in RTC 3.0.1.x you go to the process configuration.....work items>work item customization. There you create your calculated value provider and upload your script. It is automatically attached to the process (Links>attachments). You then add the calculated value provider to your attribute and check the dependent attributes so that you get triggered on changes.

There is also an article in the library that walks you trough this, I think.

0 votes

Comments

How can you see the "work item customization" option from the web ui?


Permanent link
How can you see the "work item customization" option from the web ui?

0 votes

Comments

The work item customization is not in the web ui, only eclipse.  At least not the attribute customization settings that you are implementing.

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,938

Question asked: Mar 16 '12, 11:29 a.m.

Question was seen: 5,828 times

Last updated: May 07 '14, 1:09 p.m.

Confirmation Cancel Confirm