It's all about the answers!

Ask a question

Attribute customization Story story points


Natalia Liaskovski (5711219) | asked Dec 11 '15, 8:56 p.m.
 I would like to make non-editable and calculate story points for a Story based on the cumulative of it's children work item points.

I also would like to track story progress by adding up all points of completed children work items. The only way I see how this can be done is by adding attribute customization (or may be there is a different mechanism, if yes please let me know what it is ). 

How can I query all the children of a work item ? E.g. here:

dojo.provide("com.myteam.StoryPointTotalsProvider");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");

(function() {
    dojo.declare("com.myteam.StoryPointTotalsProvider", null, {

        getValue: function(attribute, workItem, configuration) {
                 var id = workItem.getValue(WorkItemAttributes.ID);
                 var children = configuration.getChildren(id); // is this how to obtain all children of the story work item ?
                 var  storyPoints = 0;
                 for(var i =0 ; i < children.length;i++){
                     storyPoints += children[i].getValue("com.ibm.team.apt.attribute.complexity");
                  }
                  return storyPoints ; 

        }
    });
})();

3 answers



permanent link
Donald Nong (14.4k314) | answered Dec 13 '15, 11:19 p.m.
I don't think you can do it that way. The parent/child relationship is basically a type of links. And I am not aware of the JavaScript API being able to handle link types.

Comments
Natalia Liaskovski commented Dec 14 '15, 7:54 a.m. | edited Dec 14 '15, 8:13 a.m.

 Thanks, Donald. 


Yes, the parent - child relationships are links (the code above is a crude approximation just for illustration purposes). I thought that may be it is possible to do a query in js to collect all children work item IDs ? Is there any way to do what I want (I don't care if it is js, java plugin, or any other means) ?

Thank you


Jonas Studer commented Jan 15 '16, 7:59 a.m.

Donald has no idea about the JS API but spams his opinions...
I already told you once, that it IS possible to set or read links from Workitems!


Ralph Schoon commented Jan 15 '16, 8:05 a.m. | edited Jan 15 '16, 8:10 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Jonas,

consider to edit or delete your comment, I find it quite offensive. This is a forum for professionals. Behave that way, please.

Donald refers to the JavaScript Attribute Customization which is the topic of the question and, as he correctly mentions, can not access links (for all I know and what is written down). At least not with the published API. There might be ways to do it that might work in the Web UI, but that would not be officially supported.

To do something as requested above you would typically use an approach like described here:
RTC Update Parent Duration Estimation and Effort Participant

Please note, that the planning component already does that for you in plans.


permanent link
Ralph Schoon (59.7k23643) | answered Dec 14 '15, 8:01 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
For all I know JavaScript will not work. Here is a description how to achieve something similar using a Java server extension: https://rsjazz.wordpress.com/2012/07/31/rtc-update-parent-duration-estimation-and-effort-participant/

Please note that story points for child stories are rolled up to epics in plans. If you use the built in story points with automation as above, all the roll up in plans would be broken.

Comments
Jonas Studer commented Jan 15 '16, 8:15 a.m.

Mister Schoon,

IT IS Possible! I for myself use the child items to see if a parent is overdue or not.

Here's one way to get the children of a specific workItem.
You can test it with RESTClient i.E.

https://"YourServer"/"YourApplication"/oslc/workitems/"ID_OF_ITEM"/rtc_cm:com.ibm.team.workitem.linktype.parentworkitem.children?oslc_cm.properties=rtc_cm:archived,rtc_cm:contextId,dc:identifier,dc:title,rdf:resource,rtc_cm:startDate,rtc_cm:endDate,dc:type{{}},rtc_cm:filedAgainst{{}},rtc_cm:state{{}},rtc_cm:plannedFor{{}},rtc_cm:teamArea{{}},oslc_cm:priority{{}},rtc_cm:com.ibm.team.apt.attribute.complexity{{}},rtc_cm:timeline{{}}

https://localhost:7443/jazz/oslc/workitems/3/rtc_cm:com.ibm.team.workitem.linktype.parentworkitem.children?oslc_cm.properties=rtc_cm:archived,rtc_cm:contextId,dc:identifier,dc:title,rdf:resource,rtc_cm:startDate,rtc_cm:endDate,dc:type{{}},rtc_cm:filedAgainst{{}},rtc_cm:state{{}},rtc_cm:plannedFor{{}},rtc_cm:teamArea{{}},oslc_cm:priority{{}},rtc_cm:com.ibm.team.apt.attribute.complexity{{}},rtc_cm:timeline{{}},


Ralph Schoon commented Jan 15 '16, 8:34 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Jonas, please - carefully - read the context of this question carefully and realize that this is attribute customization. See https://jazz.net/wiki/bin/view/Main/AttributeCustomization .

There is no documentation in that API how to do that. In fact, a change in a different work item can even not trigger this. The attribute customization also runs in the Eclipse client, in case you use it. Where it is absolutely unclear, what other framework classes you have and what you can do - e.g. you don't have a session object. You don't even have a hint of the server URL, etc.

I am fully aware that you can use REST and OSLC to do all kinds of magic and stuff with JavaScript. But it is always a question in which context you want to do that.



permanent link
sam detweiler (12.5k6184201) | answered Dec 14 '15, 8:29 a.m.
and, story points in the traditional Agile mode cannot be summed. because it is a measure of complexity, not duration. (unless you changed to ideal days as the measure.

it would be better to use count of child tasks completed vs total number of tasks.  yes, this does not take into account those hard tasks.   So much fun!..

Comments
Geoffrey Clemm commented Dec 23 '15, 12:34 a.m. | edited Dec 23 '15, 12:35 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

In most tools that support agile that I'm aware of (including RTC), story points numbers can be summed (and as Ralph points out, they are summed by RTC).   

Your answer


Register or to post your answer.