It's all about the answers!

Ask a question

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


De'Shea Bennett (166) | asked Mar 13 '13, 3:37 p.m.
edited Nov 21 '14, 3:52 a.m. by Ralph Schoon (63.3k33646)

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;          
            
        
}
    
});
})();


Comments
Ralph Schoon commented Nov 21 '14, 3:47 a.m. | edited Nov 21 '14, 3:47 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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
Eric Jodet (6.3k5111120) | answered Mar 14 '13, 9:15 a.m.
JAZZ DEVELOPER
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

Comments
De'Shea Bennett commented Mar 14 '13, 6:19 p.m.

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?


Eric Jodet commented Mar 15 '13, 1:57 a.m.
JAZZ DEVELOPER

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.


Ryan McBryde commented Nov 20 '14, 1:01 p.m.

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


Eric Jodet commented Nov 21 '14, 1:33 a.m.
JAZZ DEVELOPER

 Hello Ryan,

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

Eric


Ralph Schoon commented Nov 21 '14, 3:44 a.m. | edited Nov 21 '14, 3:45 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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