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;
}
});
})();
Accepted answer
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.
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 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/
Comments
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Nov 21 '14, 3:47 a.m.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.