Dynamic read only attribute not working in project area.
Hi,
We are using RTC 4.0.1 and trying to implement Read Only attribute based on condition. Followed article https://jazz.net/library/article/997. I have small string attribute which will not be saved as script below returns true.
The script is simple test script as below
dojo.provide("com.example.Condition1");
(function() {
dojo.declare("com.example.Condition1", null, {
matches: function(workItem, configuration) {
return true;
}
});
})();
The script and dynamic read only attribute works well for JKE Banking project(pre-condition was configured for everyone). However it is not working for other project where we have pre conditions based on roles. I tried it for everyone role as well but it is allowing me to save the changes.
Can anyone help us on this?
My main goal is to use below script and not allow user to save work item when he tries to book more than estimated effort. Can i use Timespent for readonly or something else has to be used
dojo.provide("buza.estimateOverRun1");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
(function() {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
dojo.declare("buza.estimateOverRun1", null, {
matches: function(attribute, workItem, configuration) {
var estimate = workItem.getValue(WorkItemAttributes.ESTIMATE);
var correctedEst = workItem.getValue(WorkItemAttributes.CORRECTED_ESTIMATE);
var timeSpent = workItem.getValue(WorkItemAttributes.TIME_SPENT);
if (correctedEst > 0 && timeSpent>=correctedEst)
{
return true;
}
else if (estimate >0 && timeSpent>=estimate)
{
return true;
}
else
{
return false;
}
}
});
})();
We are using RTC 4.0.1 and trying to implement Read Only attribute based on condition. Followed article https://jazz.net/library/article/997. I have small string attribute which will not be saved as script below returns true.
The script is simple test script as below
dojo.provide("com.example.Condition1");
(function() {
dojo.declare("com.example.Condition1", null, {
matches: function(workItem, configuration) {
return true;
}
});
})();
The script and dynamic read only attribute works well for JKE Banking project(pre-condition was configured for everyone). However it is not working for other project where we have pre conditions based on roles. I tried it for everyone role as well but it is allowing me to save the changes.
Can anyone help us on this?
My main goal is to use below script and not allow user to save work item when he tries to book more than estimated effort. Can i use Timespent for readonly or something else has to be used
dojo.provide("buza.estimateOverRun1");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
(function() {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
dojo.declare("buza.estimateOverRun1", null, {
matches: function(attribute, workItem, configuration) {
var estimate = workItem.getValue(WorkItemAttributes.ESTIMATE);
var correctedEst = workItem.getValue(WorkItemAttributes.CORRECTED_ESTIMATE);
var timeSpent = workItem.getValue(WorkItemAttributes.TIME_SPENT);
if (correctedEst > 0 && timeSpent>=correctedEst)
{
return true;
}
else if (estimate >0 && timeSpent>=estimate)
{
return true;
}
else
{
return false;
}
}
});
})();