How to set RITM fields readonly through Business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2022 08:32 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2022 02:40 AM
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.
Regards,
Datta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2022 03:07 AM - edited 10-04-2022 03:10 AM
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.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2022 12:46 AM
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.