Restrict visibility of attachment on SCTASK and RITM activity

RaginiP
Tera Contributor

Hello,

 

ON RITM and sc_task, only members from a particular group should be able to access attachments attached in Catalog Item Variables from the activity section. How to achieve this

 

Any Insights into this are highly appreciated. 

3 REPLIES 3

Ankur Bawiskar
Tera Patron

@RaginiP 

you want to hide attachments from activity log based on group membership?

If yes then it can't be done without DOM manipulation

If you still wish to use DOM then check this link where I shared solution for something similar and enhance it by checking group membership and attachment

Note: DOM manipulation is not recommended

Hide Image Activities from RITM 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

ThanksAnkur,
Is there an alternative approach available for this

SohamTipnis
Tera Guru

Hi @RaginiP,

 

You can achieve this by using the onload() client script; you can use the below code:

 

 

 

function onLoad() {
    //Type appropriate comment here, and begin script below

    var group;
    var assi_gr = g_form.getValue('assignment_group');
    if (assi_gr == 'hardware') {
        g_form.enableAttachments(true);
    }	
    else{
          g_form.enableAttachments(false);
}
}

 

 

 

If you find my answer useful, please mark it as Helpful and Correct ‌😊


Regards,
Soham Tipnis
ServiceNow Developer ||  Technical Consultant
LinkedIn: www.linkedin.com/in/sohamtipnis10