only he/she can able to see the incident which are assigned to his/her group only

pattnaiksub
Tera Contributor

when a user login at that time when he/she try to open the incident table. only he/she can able to see the incident which are assigned to his/her group only .

3 REPLIES 3

sandeep1708
Tera Contributor

Hi @pattnaiksub 

 

Create a before query business rule on incident table to restrict user view all records,

Script: 

if (!gs.hasRole("admin")) {
var groups = gs.getUser().getMyGroups();
var groupIds = [];

while (groups.hasNext()) {
groupIds.push(groups.next().getUniqueValue());
}

if (groupIds.length > 0) {
current.addQuery("assignment_group", "IN", groupIds.join(","));
} else {
current.addQuery("sys_id", "NONE");
}
}

 

Please mark my answer as helpful/correct if it resolves your query.

 

Regards,

Sandeep

WillieW
Tera Expert

Hi @pattnaiksub.,

 

I use the following business rule:

 

Screenshot 2025-06-22 165146.png

The When tab:

Screenshot 2025-06-22 165345.png

AndersBGS
Tera Patron

Hi @pattnaiksub ,

 

 not sure what you’re asking - do you want to restrict incident view, so people can only see incidents for their queue or?