It's all about the answers!

Ask a question

Custom required attributes


g k (17148) | asked Aug 22 '16, 5:56 a.m.
 Hi,

Trying to write a custom attribute condition script to force a comment to get entered when a user selects a certain 
option from a radio group e.g no.


dojo.provide("storagereq");
(function() {
    dojo.declare("storagereq", null, {
        getValue: function(attribute, workItem, configuration) {
     var storreq =  workItem.getLabel("storagerequests");
return (storreq !== "No");
     }
    });
})();


also added the "required attribute for condition" in operation behaviors section and associated with relevant comment attribute.

Can you advise on what im doing wrong with script.

thanks

Accepted answer


permanent link
sam detweiler (12.5k6195201) | answered Aug 22 '16, 9:44 a.m.
note that you cannot tell IF a comment was added or not in scripts.. only in a java server side extension.(advisor)

scripts are not passed access to the state of the workitem prior to the change which caused the script to be invoked


Ralph Schoon selected this answer as the correct answer

One other answer



permanent link
sam detweiler (12.5k6195201) | answered Aug 22 '16, 9:41 a.m.
what is the ID of the attribute?

I normally name mine with some info like this (using your name)

com.sd.defect.attribute.storagerequests

you must use the complete ID.. for custom attributes

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.