Assigning current Time Stamp upon closure of defects
Hi
I'm currently working with RQM 3.0
A new field "Closing_Date" in defects is added to capture closing date of the defect.
It would be a mandatory field when user tries to move defect to "CLOSED" status.
But, while doing so it should pick up the current time stamp.
I heard that this can be achieve with a Dojo script?
Any guidance on this please.....
Thanks
I'm currently working with RQM 3.0
A new field "Closing_Date" in defects is added to capture closing date of the defect.
It would be a mandatory field when user tries to move defect to "CLOSED" status.
But, while doing so it should pick up the current time stamp.
I heard that this can be achieve with a Dojo script?
Any guidance on this please.....
Thanks
3 answers
I assume you are using RTC as the defect provider. RTC defects already have a "resolution date" attribute that does this. If you've looked into this field already could you explain why it is insufficient?
In general the answer to your question is to edit the RTC project area process configuration via the Eclipse client:
1. Create a script based calculated value
2. Create a new timestamp attribute for the defect work item
3. Select the script created in step 1 in the "Calculated Value" dropdown of the new attribute
4. Configure the new attribute to have a dependency on the "Status" attribute.
5. Add a read only presentation for your new attribute to the defect editor
This post contains a good sample script that manipulates dates. Your script will need to be modified, for example to take the state of the workitem into account.
https://jazz.net/forum/questions/83120/how-to-show-the-difference-between-current-date-and-due-date-through-script-based-calculated-value
In general the answer to your question is to edit the RTC project area process configuration via the Eclipse client:
1. Create a script based calculated value
2. Create a new timestamp attribute for the defect work item
3. Select the script created in step 1 in the "Calculated Value" dropdown of the new attribute
4. Configure the new attribute to have a dependency on the "Status" attribute.
5. Add a read only presentation for your new attribute to the defect editor
This post contains a good sample script that manipulates dates. Your script will need to be modified, for example to take the state of the workitem into account.
https://jazz.net/forum/questions/83120/how-to-show-the-difference-between-current-date-and-due-date-through-script-based-calculated-value
Comments
Just to have the complete script that works for me for "Reopen Date":
And to follow the same behavior like "resolution date" I make the field read only on the presentation.
-----------------
dojo.provide("com.example.ValueProvider");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
(function() {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
dojo.declare("com.example.ValueProvider", null, {
getValue: function(attribute, workItem, configuration) {
var currentDate= new Date();
if (workItem.getValue(WorkItemAttributes.STATE)=="6") {
return currentDate.getTime().toString();
}
return 0;
}
});
})();
-------------------
And to follow the same behavior like "resolution date" I make the field read only on the presentation.
-----------------
dojo.provide("com.example.ValueProvider");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
(function() {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
dojo.declare("com.example.ValueProvider", null, {
getValue: function(attribute, workItem, configuration) {
var currentDate= new Date();
if (workItem.getValue(WorkItemAttributes.STATE)=="6") {
return currentDate.getTime().toString();
}
return 0;
}
});
})();
-------------------