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

RTC: Display child work item's attribute value in parent?

Is their a way to display child work item's attribute value in parent?

For example below I was trying to get the child's estimate value displayed in the parent.

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

    
dojo.declare("com.example.ValueProvider", null, {

        
getValue: function(attribute, workItem, configuration) {
    
             
var result= configuration.getChild("Estimate"); 

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

0 votes

Comments

configuation.getChild() only gets y child node in the process configuration XML, and not the child of the work item, or even an attribute at the child.


Accepted answer

Permanent link
Hello,
I don't think the above code will do what you expect - see https://jazz.net/wiki/bin/view/Main/AttributeCustomization#API_for_Javascript

Please also note that current API has limited support for work items:
Currently there is no dedicated API to work with Items or Enumerations and scripts can only use the id of such attributes. If you need additional information, such as the name that corresponds to an Enumeration literal id, you can pass it to scripts using configuration parameters.

This said - Ralph will confirm - you may use a participant that will be triggered on save action,
as per this sampel - http://rsjazz.wordpress.com/2012/07/31/rtc-update-parent-duration-estimation-and-effort-participant/

Hope it helps.
Eric.

Ralph Schoon selected this answer as the correct answer

0 votes

Comments

Thanks for your quick response Eric.

I am going through the Extensibility document but could you tell me how a participant automated build will update the parent when the child is changed?

Hello,
please refer to https://jazz.net/library/article/1000
the update should take place when you save a child work item,
calculate to overall estimate, and update the parent's attribute automatically.

Thanks.
Eric.

Hi Eric,

Would it also be possible to implement this using Calculated Values so that the update of the estimate would occur dynamically and not have to "wait" on the save of the child work item?

Thank you,

Ryan

 Hello Ryan,

as per previous answers, I don't think it's possible.

Eric

As far as I can say this is not possible today, at least not with JavaScript as Eric stated.

In a follow up action you have to execute the save to trigger the behavior.

However, there is another option that you probably use to get the value of the child in a calculated value however using Java. See https://rsjazz.wordpress.com/2013/06/26/attribute-customization-java-based-value-providers-conditions-and-validators/

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: Mar 13 '13, 3:37 p.m.

Question was seen: 4,447 times

Last updated: Nov 21 '14, 3:52 a.m.

Confirmation Cancel Confirm