How to restrict attachment visibility based on groups in incident

Vijay Kumar4
Mega Guru

I have created a new record producer that requires a mandatory attachment. After the record is submitted, the attachment should be visible only to members of a specific group, and this restriction should apply only to incidents created through this particular record producer. How can I achieve this using a script or ACL?

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Vijay Kumar4 

do this

1) have an onLoad client script and check using GlideAjax if this record got generated by your record producer

2) this table stores that information sc_item_produced_record; you can query with the field

3) then use group membership and hide the attachments

Hide Attachments based on Assignment Group 

Is it possible to hide attachments from users based upon a client script? 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@Vijay Kumar4 

do this

1) have an onLoad client script and check using GlideAjax if this record got generated by your record producer

2) this table stores that information sc_item_produced_record; you can query with the field

3) then use group membership and hide the attachments

Hide Attachments based on Assignment Group 

Is it possible to hide attachments from users based upon a client script? 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

@Ankur Bawiskar Thanks for your reply.

Using the below code, I can hide the attachment from the top.

var attachmentSection = document.getElementById('header_attachment');
        if (attachmentSection) {
            attachmentSection.style.display = 'none'; 
        }

 But It is still visible in the Activities:

VijayKumar4_0-1729513192524.png

Is there any solution for this?

@Vijay Kumar4 

I believe I have answered your original question.

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

@Vijay Kumar4 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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