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 Contributor

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
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?

 

If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.

Best regards
Anders

Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/