How to make 'Additional comments' and 'Work notes' under 'Note' tab Read-only?

Subhashree3
Giga Contributor

Hi All,

Is it possible to make 'Additional comments' and 'work notes' under 'Note' tab Read-only? As per my findings, if we add any comments, it doesn't get stored in the sc_task table but gets stored in 'sc_req_item' table. Please suggest how it can be achieved.

Thank you!

1 ACCEPTED SOLUTION

Hi Subhashree,

sample screenshot below

you need security_admin role to create new ACL

in left navigation type Access Control; click New

give the role you want users to read in the roles section in the ACL

repeat this for work notes field as well; I have shown for Additional Comments field

find_real_file.png

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

9 REPLIES 9

Hi Subhashree,

What is your exact requirement here?

Is it to hide those fields for all users except if they belong to specific group

OR

you want to copy the comments from RITM to TASK table?

 

Regards

Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Requirement is to hide the additional comments field present in the Note tab for a specific group.

But during my analysis I found out when I add any comment, it gets stored in sc_req_item table, not in sc_task table. I am thinking to copy the additional comments to sc_task from sc_req_item table and after that I can hide/restrict the visiblity on sc_task table. Please suggest if it is possible.

Hi Subhashree,

So you can make those fields as hidden using table.field level READ ACL

if that group has some role give that in the roles section

If not role is present then use advanced checkbox and use script below

answer = getValue();

function getValue(){

if(gs.getUser().isMemberOf('Group A'))

return true;

else

return false;

}

Now regarding copying value from sc_req_item to sc_task table; if RITM has 4 Tasks then do you want to copy to all records or specific?

What is the use case here to copy and why you want to copy?

If you want to copy then have an after update business rule on sc_req_item table which has condition as additional comments changes or work_notes changes

then in script do following

query all sc_task for this RITM

var gr = new GlideRecord('sc_task');

gr.addQuery('request_item', current.sys_id);

gr.query();

while(gr.next()){

if(current.work_notes.changes())

gr.work_notes = current.work_notes;

else if(current.comments.changes())

gr.comments= current.comments;

gr.update();

}

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

 

Thank you so much for your explanations 🙂

Could you please guide me more on your point 'you can make those fields as hidden using table.field level READ ACL' ??

 

Hi Subhashree,

sample screenshot below

you need security_admin role to create new ACL

in left navigation type Access Control; click New

give the role you want users to read in the roles section in the ACL

repeat this for work notes field as well; I have shown for Additional Comments field

find_real_file.png

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader