How to set RITM fields readonly through Business rule

Datta Pisal1
Tera Contributor

Hi All,

I have below scenario and need help for this,

i am creating a change and ctask through service catalog request.

 so brought  a field called parent (Requested item backend name :parent.parent) on Ctask form and i need to make its variables readonly after ctask closed (for testing taken target_ci variable only). so thinking to do it through business rule but it is not working, Please help me to solve this.

 

Conditon : After update , status is closed

 

Script:

(function executeRule(current, previous /*null when async*/) {

var gr = new GlideRecord('sc_req_item');
gr.addQuery('sys_id',current.parent.parent);
gr.query();

if(gr.next()){

gr.setReadOnly('gr.variables.target_ci',true);

gr.update();
}

})(current, previous);

 

Thanks & Regards

7 REPLIES 7

Hi Mahendra,

 

Thank you for your reply.

My Requirement is as below could you please me to build this scenario.

I have requirement to set ritm variables read only after closing ctask so how I can achieve this.

 

DattaPisal1_0-1664876306511.png

Regards,

Datta

 

So you can create an ACL on you change_task as shown below. If you want the field to be editable for Admin users then check Admin overrides checkbox.

MahendraRC_0-1664877995243.pngMahendraRC_1-1664878048391.png

You can also use the UI Policy but the field will then be editable from list view. If you don't want it to be editable in list view then use the ACL.

 

Hello @Datta Pisal1 

Just wanted to check with you, if the above response answered your question. If yes, then please do close this thread/question by marking the appropriate response as correct.