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

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;
            }
        }
   
    });
})();


0 votes



One answer

Permanent link
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.

0 votes

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
× 6,125

Question asked: Jul 21 '14, 7:04 a.m.

Question was seen: 3,768 times

Last updated: Jul 22 '14, 2:48 a.m.

Confirmation Cancel Confirm