how to get timeline value for workitem using calculated script.
I am trying to get the timeline value for particular workitem. I can able to get the iteration value for workitem , but not able to find the timeline value for that particular iteration value. Please check the below code and let me know if any solutions are available.
/*******************************************************************************
* Licensed Materials - Property of IBM
* (c) Copyright IBM Corporation 2011. All Rights Reserved.
*
* Note to U.S. Government Users Restricted Rights:
* Use, duplication or disclosure restricted by GSA ADP Schedule
* Contract with IBM Corp.
*******************************************************************************/
dojo.provide("com.xx.rtc.js.estimationtoollink");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
(function() {
dojo.declare("com.xx.rtc.js.estimationtoollink", null, {
getValue: function(attribute, workItem, configuration) {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
var state=workItem.getValue( WorkItemAttributes.STATE );
var category=workItem.getValue(WorkItemAttributes.FILED_AGAINST);
var workitemid= workItem.getValue(WorkItemAttributes.ID);
var iteration= workItem.getValue(WorkItemAttributes.PLANNED_FOR);
return "http://sgp-v-0021u.sgp.apac.bosch.com/Estimate/estimation" + "/"+workitemid+ "/"+category;
}
});
})();
* Licensed Materials - Property of IBM
* (c) Copyright IBM Corporation 2011. All Rights Reserved.
*
* Note to U.S. Government Users Restricted Rights:
* Use, duplication or disclosure restricted by GSA ADP Schedule
* Contract with IBM Corp.
*******************************************************************************/
dojo.provide("com.xx.rtc.js.estimationtoollink");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
(function() {
dojo.declare("com.xx.rtc.js.estimationtoollink", null, {
getValue: function(attribute, workItem, configuration) {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
var state=workItem.getValue( WorkItemAttributes.STATE );
var category=workItem.getValue(WorkItemAttributes.FILED_AGAINST);
var workitemid= workItem.getValue(WorkItemAttributes.ID);
var iteration= workItem.getValue(WorkItemAttributes.PLANNED_FOR);
return "http://sgp-v-0021u.sgp.apac.bosch.com/Estimate/estimation" + "/"+workitemid+ "/"+category;
}
});
})();
One answer
As far as I am aware you can only get the value of an attribute. The official JavaScript API provides getValue() and getLabel(). That value is usually related to the display value. For complex items sometimes you get an ID or UUID. But the supported API does not allow to get more details from complex items. You can not get or follow links, you can not get the timeline from the iteration or more data for the iteration etc. In summary there is no public JavaScript API to get the timeline from the iteration. At least I am not aware of any.