It's all about the answers!

Ask a question

Work item not saving due to Condition based Read only attribute script in RTC


CLM _User (2113) | asked Sep 02 '21, 6:35 a.m.
edited Sep 02 '21, 6:40 a.m.

 Hi Team,


I wrote custom utility using  RTC client API's which updates the work item attribute values in bulk, but same attributes I set as read only based on condition, so no one can update it manually, but now my utility is not working and not giving an any error, in debugging I have seen attributes are set and workitem saved correctly using workItem.setValue(attribute, value); workingCopy.save(null); but still values are not displaying in workitem,

 when I remove the below script then it is working fine as expected.


/*********** 
 ***********/
dojo.provide("test);

(function() {
    dojo.declare("test", null, {
    
        matches: function(workItem, configuration) {
        var type = workItem.getValue('enumattrib');
                return (enumattrib=='type.literal.test');
        }
    });
})();

One answer



permanent link
Ralph Schoon (63.1k33645) | answered Sep 30 '21, 3:52 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 There is no logging information or whatever to help here.


As far as I know, if a work item attribute is read only, it should not be modifiable for the API either.
You should use a WorkItemOperation and not save workingcopy. See https://rsjazz.wordpress.com/2013/03/20/understanding-and-using-the-rtc-java-client-api/ that shows this. In any case, the work item save should provide a save status that should provide at least some hint that it failed.

As far as I am aware the attribute customization scripts are not run if you use API calls to save work items. You would have to talk to the project area administrators what that condition does. A condition can be used in an advisor to make attributes read only.

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.