Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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?

 Hi,


In Rational Team Concert 6.0.5, is it possible to set the value "None" to the attribute of type 'timestamp' using Attribute Customisation, which should be reflected during work item initialisation? Thank you in anticipation.

Regards,
Aishwarya Sureban

0 votes


Accepted answer

Permanent link

 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: 
 
 

 And here the result without scripts (note I made sure the script above ran)
   
 
This is the Web UI, where none is displayed slightly different - in not showing anything.

 
This is 6.0.6, but I have no reason to believe this would be different with 6.0.5. I have done this stuff with almost all versions and there should be no difference in the behavior, except if there is a defect or the project area process is causing some weird effect. 
 
Consider talking to support.

Aishwarya Sureban selected this answer as the correct answer

0 votes

Comments

Hi Ralph,


Thank you for your valuable time and support. 
I have implemented the scripts as per your suggestions. But, still it is not working. I think project area process is having some effect.

Regards,
Aishwarya Sureban 

See my edit for the Web UI, where the default/non value is shown as empty attribute.  

Hi Ralph,


I have used the scripts as per your suggestions in RTC 6.0.5. It is working successfully in the eclipse client. It displays 'None' in the timestamp attribute. But the same feature is not reflected in the web client. Is there any way so that value 'None' can be reflected in the web client as well? 

Regards,
Aishwarya Sureban

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

Permanent link
1. If you refer to the creation or modification date, you can not override the values as far as I can tell.
2. If you refer to a custom attribute of type timestamp, the default value is usually unassigned/None. Use console.log in a JavaScript Attribute Customization to print find which value is used for an unassigned timestamp

0 votes

Comments

 Hi Ralph, 


Thank you for the response.
Yes, I have created a new attribute with type 'Timestamp', and I want to set the default value of this attribute as "None".

The default value of timestamps is always None

 The default value of timestamps is always 'None' for RTC 6.0.3 .

But there is no default value for timestamps in RTC 6.0.5 . Furthermore as I want to set 'None' for timestamps in RTC 6.0.5., I just wanted to know whether is it possible to set the value using Attribute Customisation or not.?

  • 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 

As per your suggestions, I have implemented the script. The value 'None' is not displayed during work item initialization. Calculated Value Script that I have written is as follows;

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;

  }
});
})(); 

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Oct 23 '18, 1:24 a.m.

Question was seen: 3,416 times

Last updated: Oct 26 '18, 12:21 a.m.

Confirmation Cancel Confirm