It's all about the answers!

Ask a question

Dynamic read only attribute not working in project area.


Rhishikesh Patil (1311827) | asked Jul 21 '14, 7:04 a.m.
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;
            }
        }
   
    });
})();


One answer



permanent link
Ralph Schoon (63.1k33646) | answered Jul 22 '14, 2:48 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Can you try to debug this with outputs, the log files, or the FireFox or Chrome debugger? See https://jazz.net/library/article/1093 Lab 5 for hints.

Your answer


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