In Rational Team Concert 6.0.5, Is it possible to set "None" value to the timestamp attribute which will be reflected during work item initialization?
Accepted answer
These scripts are absolutely useless, because the default for custom timestamps is null, however, they work provided:
- Attribute customization is enabled
- The timestamp attribute is configured correctly
/*********** * 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.example.CalculatedNullTimestamp");(function() { dojo.declare("com.example.CalculatedNullTimestamp", null, {
getValue: function(attribute, workItem, configuration) { return null; } });})();
</pre> and <pre>/*********** * 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.example.DefaultNullTimestamp");(function() { dojo.declare("com.example.DefaultNullTimestamp", null, {
getDefaultValue: function(attribute, workItem, configuration) { return null; } });})();
Result:
This is the Web UI, where none is displayed slightly different - in not showing anything.
Consider talking to support.
Comments
Hi Ralph,
See my edit for the Web UI, where the default/non value is shown as empty attribute.
Hi Ralph,
As shown in the last image in the answer in the web UI, any unassigned Timestamp shows as blank/empty field. This is as designed.
Yes, Thank you Ralph.
One other answer
Comments
Hi Ralph,
The default value of timestamps is always None.
The default value of timestamps is always 'None' for RTC 6.0.3 .
- Yes, it is possible to set the value using attribute customization.
- The behavior has not changed since 4.x
- the default for timestamps is null - so a default value provider makes no sense at all
- It is possible to create a default and a calculated value provider for timestamp attributes that sets no value - Java Script, return null for no value
dojo.provide("example.calculated.return_none_default");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
dojo.require("dojo.date");
dojo.require("dojo.date.stamp");
(function() {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
dojo.declare("example.calculated.return_none_default", null, {
getValue: function(attributeId, workItem, configuration) {
//To fetch the date attribute value.
var dateField = dojo.date.stamp.fromISOString(workItem.getValue("actual_end_date"));
var dateField = null;
return dateField;
}
});
})();