Vendor group members restricted to see tickets only assigned to them

Zubair Alam
Tera Contributor

We have a requirement:
If Vendor Group in checked (see screenshot), the members of such group should only be able to see the tickets assigned to their group only. 
What is the best way to address this requirement? ACL/Query Business Rule??
All help is greatly appreciated. Thanks. 

 

ZubairAlam_0-1735058381032.png

 

2 ACCEPTED SOLUTIONS

@Zubair Alam 

you can have it at task level but ensure it runs only for problem, change, incident

OR

create separate one on each of those tables

Thank you for marking my response as helpful.

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

Thank you for marking my solution as helpful! The community now supports multi-solution acceptance, allowing you to accept multiple answers.

View solution in original post

14 REPLIES 14

Ankur Bawiskar
Tera Patron
Tera Patron

@Zubair Alam 

you can use query business rule on your table

1) get the logged in user's group

2) then query groups table with Vendor group checkbox as true

3) store only those groups in an array and use that in encodedQuery

something like this

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

    // Add your code here
    var arr = [];
    var gr = new GlideRecord("sys_user_grmember");
    gr.addQuery("user", gs.getUserID);
    gr.addQuery("group.u_vendor_group", true);
    gr.query();
    while (gr.next()) {
        arr.push(gr.getValue('group'));
    }
    current.addQuery('assignment_group.sys_id', arr.toString());

})(current, previous);

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

Thanks @Ankur Bawiskar . One question. Do we have to do this separately for all types of tickets (Incident, Problem, Change, Request) OR can we create this business rule to the task table to cover all ticket types?
Thanks for the help. 

@Zubair Alam 

you can have it at task level but ensure it runs only for problem, change, incident

OR

create separate one on each of those tables

Thank you for marking my response as helpful.

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 Ankur. Yes, your response provided me the detail that I pretty much needed. Thanks for all the help.

@Zubair Alam 

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