dojo script for calculated values are behaving differently in Production and QA
![]() Hi,
We have two different environments called Production and QA (Test machine) which has same configuration and settings. But we seen an strange behavior with dojo script calculated value for custom attribute (called "Shared Date"), which will populate the date depends on the boolean attribute(Shared).
i.e.: dojo script set the "Shared date" field with date when "Shared" attribute is set true.
Below dojo script is used to populate the date for shared date.
======================================================================
dojo.provide("com.visteon.shareddate");
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("com.visteon.shareddate", null, {
getValue: function(attributeId, workItem, configuration)
{
console.log("Enter sharedDate");
var sharedDate= dojo.date.stamp.fromISOString(workItem.getValue("com.visteon.shared.date"));
var isShareable = workItem.getValue("com.visteon.shareable");
var currentDate= new Date();
// console.log("Shared date is " + sharedDate);
// console.log("Shareable box is " + isShareable);
// console.log("CurrentDate is " + currentDate);
if(sharedDate == null)
{
// console.log("SharedDate is null");
if(isShareable == true)
{
// console.log("shareable checkbox is checked");
return currentDate.getTime().toString();
}
// console.log("shareable checkbox is NOT checked");
}
// console.log("SharedDate is NOT null");
return sharedDate.getTime().toString();
}
});
})();
====================================================================
Issue: "Shared date" is added for defect WI on March 2016 and did not sync attribute for existing WI, as it is required only for newly created WIs. calculated value is configured with dojo script were expected to fill the date when shared attribute is selected enable. But the work items which was created before March 2016, is showing Shared Date attribute value as current date(i.e Date when you run the query) in web and even exports the same in eclipse. However the same dojo script works as expected in QA environment, it is not showing any date for the work items where shared date attribute is not sync.
We noticed this issue only after upgrading our environment from RTC 5.0.2 to RTC 6.0.2 iFix006.
Please let me know is there any settings we have to consider for RTC 6.0.2 or do we need do any changes in dojo script.
Thanks in advance.
|
Be the first one to answer this question!
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.
Comments
Running a query does not trigger the calculated value script. So what you described is a bit confusing. If you open a work item from the query result set, do you see the same current date value in the "Share Date" attribute?
What does "where shared date attribute is not sync" mean?
Hi Ralph Schoon,