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

Custom required attributes

 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

0 votes


Accepted answer

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

0 votes


One other answer

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

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
× 10,938

Question asked: Aug 22 '16, 5:56 a.m.

Question was seen: 1,518 times

Last updated: Aug 22 '16, 9:44 a.m.

Confirmation Cancel Confirm