Help with filter: Updated by != member of Assignment Group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2019 06:12 AM
I'm having a hard time with what I expected to be a straightforward filter: the request is to list only those Incidents that have been last updated by a user who is not a member of the incident's assignment group.
The first part is easy: Updated by | is not
The challenge I'm having a hard time wrapping my head around is how to correctly express the "member of the incident assignment group" in the filter. Any ideas?
Thanks!
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2019 06:21 AM
Hi,
I think you can try like this.
updated_by is NOT and then mention something like this in the text field
javascript:gs.getUser().isMemberOf(" Application Development");
Mark the comment as a correct answer and helpful if this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2019 06:30 AM
Hi,
So basically you want to show incident to User A if he/she is the updated by user for the ticket and when he/she is not member of that group assigned to incident?
what if the user has updated by as his/her name but a member of all the incidents? what to show? -> do you want to show blank incident table i.e. return no records
I have assumed this in below script that return no records when he/she is member of group
use below query in query business rule;
var isMember = gs.getUser().isMemberOf(current.assignment_group);
var encodedQuery = 'sys_updated_by=' + gs.getUserName();
if(!isMember){
current.addEncodedQuery(encodedQuery);
}
else{
// return no records
var sys_id = -1;
current.addQuery('sys_id',sys_id);
}
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2020 08:46 PM
Did you get any solution for this query, please help with the query I have similar requirement
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2020 09:04 AM
Hi
To address a second requirement, I would suggest creating a new Dynamic Filter (System Definition > Dynamic Filter Options) with a referenced client-callable script (Script Include) which provides a list of users that are not members of the specified group.
You may check an example here