ServiceNerd

ServiceNow Advanced Reference Qualifier | How to filter the Assignment group based on Assigned To

Been in a predicament in ServiceNow, where you know the person a task needs to be assigned to, but don’t know the right group? I got you!

In this video, we add an advanced reference qualifier on a dictionary override on the assignment group fields (for incidents) that calls a server side script include to run some funky glideRecord queries and return as back a refined list of group sys_id’s. Its then these groups that are shown when you click the Assignment Group magnifying glass.

https://docs.servicenow.com/en-US/bundle/tokyo-platform-administration/page/script/server-scripting/concept/c_ReferenceQualifiers.html

https://www.servicenow.com/community/developer-forum/dynamic-advanced-reference-qualifier-examples/m-p/1386576

Reference Qualifier bit:

javascript:new global.AssignmentGroupFilter().refineAssignmentGroup(current.assigned_to)

Script Include:

Tags: advanced reference qualifier beth anglin GlideRecord reference field reference qualifier script include servicenerd servicenow admin servicenow demo servicenow tutorial sysid in

You may also like...

filter assignment group based on assigned to servicenow

How to create a Variable Set

ServiceNow Flow Diagramming

ServiceNow San Diego Flow Diagramming | Flow Designer stuff #Shorts

ServiceNow Hyperlink

ServiceNow: How to embed hyperlinks in work notes | clickable links

  • Next story Flow Designer Error Handling ServiceNow | How to…
  • Previous story ServiceNow GlideAggregate Count | Is it better than GlideRecord getRowCount()

ServiceNerd_JustinMeadows

All Videos / New Features / Tips & Tricks

AI in ServiceNow with Justin Meadows | What does it mean?

February 27, 2023

ServiceNow ChatGPT

New Features / Tips & Tricks

What is ChatGPT and Can We Use it for ServiceNow

December 18, 2022

  • Recent Posts
  • Popular Posts
  • Recent Comments

ServiceNow Process Automation Designer (PAD) | What does it do?

ServiceNow Process Automation Designer (PAD) | What does it do?

December 19, 2023

filter assignment group based on assigned to servicenow

All Videos / Flow Designer

“Do the Following Until” Flow Logic in ServiceNow Flow Designer

September 1, 2023

Dynamic Flow

Exploring Dynamic Flow and Get Flow Output Logic in ServiceNow Flow Designer!

July 24, 2023

filter assignment group based on assigned to servicenow

All Videos / Flow Designer / Tips & Tricks

Flow Designer Error Handling ServiceNow | How to…

July 3, 2023

filter assignment group based on assigned to servicenow

June 11, 2023

ServiceNow Hyperlink

Service Catalog / Tips & Tricks

October 30, 2022

ServiceNow Import Set API

Integrations

ServiceNow Inbound REST API | Import Set API

September 12, 2022

filter assignment group based on assigned to servicenow

New Features / Shorts

ServiceNow San Diego Polaris | ServiceNow Next Experience UI #SanDiego #Polaris #Shorts

February 7, 2022

ServiceNow Flow Template Builder

Flow Designer

ServiceNow Flow Template Builder | Create a template using Flow Template Builder

October 6, 2022

filter assignment group based on assigned to servicenow

  • artificial intelligence business rule client script flow Flow designer Flow designer development flow designer for service catalog flow designer servicenow flow designer servicenow orlando flow designer servicenow training flow design tutorial g form glideajax GlideRecord integration hub onload script include service catalog service catalog in servicenow service catalogue servicenerd servicenow servicenow admin servicenow administrator training servicenow community servicenow demo servicenow developer servicenow developer training servicenow flow servicenow flow designer servicenow flow designer approval servicenow flow logic servicenow glideajax example ServiceNow how to servicenow integration servicenow microsoft teams servicenow new features ServiceNow Next Experience ServiceNow Polaris servicenow reference field ServiceNow San Diego servicenow shorts servicenow training servicenow tutorial subflow

ServiceNow Guru Logo

Advanced Reference Qualifier Using a Script Include

R eference qualifiers are a powerful tool that every ServiceNow administrator and consultant should have in their tool belt. They allow you to dynamically filter the available options from a reference field. The ServiceNow wiki has some good documentation on this topic so I won’t re-hash that here. What I do want to address is the topic of Advanced Reference Qualifiers…specifically how to leverage a Script Include instead of a global Business Rule to run your qualifier script.

Reference Qualifier Script Include

Up until recently, the only way to get Advanced Reference Qualifiers to work was to create a global business rule to run the qualifier script. This works great, but it results in a global script that gets loaded all the time when it really isn’t necessary. While this isn’t something that causes any real problems in practice, it could cause performance issues if used to the extreme. The best practice guidance for advanced reference qualifiers should be to use a Script Include rather than a global Business Rule to run the qualifier script. Using a Script Include means that the script only gets loaded and used when you actually need to use it! In this article I’ll show you how this can be done using a common example of filtering the ‘Assignment group’ to display only groups for the ‘Assigned to’ value.

The first piece is the ‘Reference qual’ field value on the dictionary entry of the reference field (Assignment group in this case). The ‘javascript:’ prefix is the same, but you need to reference your Script Include function instead of the business rule function. In this case, I’m using a Script Include named ‘u_backfillAssignmentGroup’. Since these scripts can potentially interfere with each other, it’s best to prefix any of your custom scripts with ‘u_’ or something similar in order to distinguish them from any that ServiceNow may introduce in the future.

The other piece is obviously the Script Include. Since Script Includes now allow you to use On-Demand functions, your script is identical to the one you would use in a global business rule.

filter assignment group based on assigned to servicenow

Mark Stanger

Date Posted:

June 21, 2011

Share This:

20 Comments

' src=

Script Includes can be a single function, too. That would reduce the complexity of this a bit. Tom Dilatush’s blog speaks to it. I use “on-demand” functions all the time for Advanced Reference Qualifiers.

http://community.service-now.com/blog/slightlyloo …

' src=

You’re right, that’s much easier! I’ve updated the article above accordingly.

Is it possible that i can dynimically change reference table on a field based on value in the another field? for example, if a table has two columns – A and B. A is of type string. B is of type reference. Can I change reference table on B based on value in A?

You would need to use a completely separate field to do that.

can you use script include in clientscripts?

Yes, there is a checkbox that enables client callable..

found it in the wiki,

Is there a way to use the same script include for client side and server side calls?

I had to make 2 different script inludes to cater each.

I am using a Script Include as a reference qualifier, but it is behaving rather strangely. When I click the magnifying glass, I get the filtered results, if I type ** in the reference field, I get the filtered results, but when I try to type in the value of what I want Firebug reports an error saying “response.responseXML is null”. The reference field filters Business Services related to the company of the caller, I created a m2m table with a related list on both Company as well as Business Services. Any idea why this is happening?

When adding the Tree Picker, is there a way when user pick a member of the group it would be able to populate the Assigned To and Assignment Group in one pick?

No way to do that currently.

Is it possible to put an condition in the attribute field? if the assign_to field is not empty then tree_picker=false.

I don’t believe so.

Can this be used on a Service Catalog variable?

made this a little bit more versatile. you can use it on Service Catalog variables as well. You can call it from any reference field’s advanced qualifier, as you can specify the reference field targettable

Tested it out and works…

Now reviewing setting the default value of the reference field to the first retrieved record, on change of the filtervaluefield

Any feedback is welcome ;-) (as I’m quite rusty in my scripting, and a newbie in Snow)

Thanks for the contribution! Please keep us up-to-date on any modifications or improvements you make.

Hey Mark, thanks for the article I’m trying to do this exact thing – create a Script Includes to use as a reference qualifier and I’m having issues, can you help?

Here is what I have so far:

But I’m still getting the following errors: WARNING at line 9: Missing semicolon.

ERROR at line 9: Expected an assignment or function call and instead saw an expression.

I’m assuming that after I get this script correct I’d just need to create a dynamic or advance reference qualifier on my assignment group field (ie javascript: u_INC_FilterAssignmentOnDisableTrigger)…… am I right?

Hey April. These types of questions are probably better suited to the ServiceNow community site. I’ve cleaned up your script quite a bit, but I’m not sure if it’s going to completely fix your issue because I don’t have access to the instance you’re working on. This script should eliminate the errors you’re seeing (and solve several other issues I noticed). If you have further questions please ask on the ServiceNow community site.

Hi I have a problem: I call a Script Include in the assignmnent_group field of the incidents… but unfortunately I found the same call also in the assignmnent_group of Changes and Problems. How can I fix this problem?

You must create a dictionary entry override for the incident table. In order to do that you need to do the following: Configure the dictionary of assignment_group Go to the Dictionary Overrides related list Click new and specify the table you want to override, in your case the Incident. Check the Override reference qualifier and populate the Reference qualifier field with your script include. Save the record.

Comments are closed.

filter assignment group based on assigned to servicenow

  • Using Import Sets for REST Integration in ServiceNow August 26th, 2024

filter assignment group based on assigned to servicenow

Achim says:

' src=

Jacob Kimball says:

  • Announcements
  • Architecture
  • Business rules
  • Client scripts
  • Content management
  • Email Notifications
  • General knowledge
  • Generative AI
  • Graphical workflow
  • Integration
  • Knowledge Management
  • Miscellaneous
  • Performance
  • Relationships
  • Script includes
  • Service Portal
  • Single Sign-on
  • System Definition
  • Web Services

Related Posts

Leveraging User Criteria in your custom applications

Leveraging User Criteria in your custom applications

Send a Knowledge Link when Attaching Knowledge

Send a Knowledge Link when Attaching Knowledge

Modifying the Label of Form Fields With Client Scripts

Modifying the Label of Form Fields With Client Scripts

Fresh content direct to your inbox.

Just add your email and hit subscribe to stay informed.

filter assignment group based on assigned to servicenow

Since 2009, ServiceNow Guru has been THE go-to source of ServiceNow technical content and knowledge for all ServiceNow professionals.

  • Using Import Sets for REST Integration in ServiceNow
  • Customize the Virtual Agent Chat Button in Service Portal
  • Leveraging Joins in GlideRecord Queries

© Copyright 2009 – 2024 | All Rights Reserved

web analytics

  • Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers
  • Advertising & Talent Reach devs & technologists worldwide about your product, service or employer brand
  • OverflowAI GenAI features for Teams
  • OverflowAPI Train & fine-tune LLMs
  • Labs The future of collective knowledge sharing
  • About the company Visit the blog

Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Get early access and see previews of new features.

Assigning the fulfillment group based on user's location using assignment lookup rules in catalog task advance script

I created a script in catalog task in workflow to find the location of the current user and find which assignment lookup rule should be use base on the location. But it's not working.

Appreciate all the help. Thank you.

Evren Yamin's user avatar

2 Answers 2

Judging by the table name that looks like a data lookup table. Is there any reason why you are not trying to implement this requirement using the Data Lookup Definitions rather than Assignment Rules?

If you are insistent on taking this route, then the last line should read

as that would be a Sys ID and not the display value of the location. The script would be running on the current task record, so it's accessed using current . Also, take steps to verify that the field name is indeed task_fulfillment_group .

Shaz's user avatar

Adding on to the given answer, please add the following at the last line of your code, provided that task is also a GlideRecord.

Rupali Bhatnagar's user avatar

Your Answer

Reminder: Answers generated by artificial intelligence tools are not allowed on Stack Overflow. Learn more

Sign up or log in

Post as a guest.

Required, but never shown

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy .

Not the answer you're looking for? Browse other questions tagged servicenow or ask your own question .

  • The Overflow Blog
  • LLMs evolve quickly. Their underlying architecture, not so much.
  • From PHP to JavaScript to Kubernetes: how one backend engineer evolved over time
  • Featured on Meta
  • We've made changes to our Terms of Service & Privacy Policy - July 2024
  • Bringing clarity to status tag usage on meta sites
  • Feedback requested: How do you use tag hover descriptions for curating and do...
  • What does a new user need in a homepage experience on Stack Overflow?
  • Staging Ground Reviewer Motivation

Hot Network Questions

  • Submitting a paper as a nonacademic practitioner in a field
  • How can you trust a forensic scientist to have maintained the chain of custody?
  • Flight left while checked in passenger queued for boarding
  • Stealth Mosquitoes?
  • Reduce String Length With Thread Safety & Concurrency
  • Where did Geordi's eyes go?
  • How does one go about writing papers as a nobody?
  • Canceling factors in a ratio of factorials
  • Feasibility of unpressurized space farms containing vacuum-adapted plants
  • When was this photo taken?
  • Does a MySQL replication slave need to be as powerful as the master?
  • Trying to find an old book (fantasy or scifi?) in which the protagonist and their romantic partner live in opposite directions in time
  • Why is not it generally accepted that tyranids are the strongest most adaptable race in w40k?
  • Is there any video of an air-to-air missile shooting down an aircraft?
  • Can I retain the ordinal nature of a predictor while answering a question about it that is inherently binary?
  • When a submarine blows its ballast and rises, where did the energy for the ascent come from?
  • Inconsistent “unzip -l … | grep -q …” results with pipefail
  • A short story about a SF author telling his friends, as a joke, a harebrained SF story, and what follows
  • Opamp Input Noise Source?
  • Why are volumes of revolution typically taught in Calculus 2 and not Calculus 3?
  • degeneration of a Veronese surface
  • default-valued optional (boolean) parameter for a new command in tikz
  • Please help me to identify specific house plant
  • Interpretation of the ideal gas single particle partition function

filter assignment group based on assigned to servicenow

Learning ServiceNow by Tim Woodruff

Get full access to Learning ServiceNow and 60K+ other titles, with a free 10-day trial of O'Reilly.

There are also live events, courses curated by job role, and more.

Assigned to and Assignment group

The Assigned to [assigned_to] field is a reference  field type that points to the Users [sys_user] table. This field is generally used to designate a user to work on, or be responsible for the task. By default, this field has a reference qualifier (role=itil) set on its dictionary record that prevents any non-itil user from being assigned to a task. You can override this reference qualifier on tables that extend task though, as the Project Task and Service Order tables do, if you have the relevant plugins installed.

The Assignment group [assignment_group] field serves pretty much the same purpose. The reason for having both, is that a workflow might automatically assign a certain type of task ticket to a group, ...

Get Learning ServiceNow now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.

Don’t leave empty-handed

Get Mark Richards’s Software Architecture Patterns ebook to better understand how to design components—and how they should interact.

It’s yours, free.

Cover of Software Architecture Patterns

Check it out now on O’Reilly

Dive in for free with a 10-day trial of the O’Reilly learning platform—then explore all the other resources our members count on to build skills and solve problems every day.

filter assignment group based on assigned to servicenow

Create an assignment group

Create an Operational Technology (OT) specific assignment group to assign to OT incident records.

Role required: admin

The Assignment Group field in an OT incident record only shows assignment groups with the type OT. This helps separate Operational Technology (OT) and Information Technology (IT) incidents.

You can create OT-specific assignment groups that you want visible on an OT incident record.

  • \n Navigate to All > User Administration > Groups . \n
  • \n Select New . \n
Table 1. Assignment groups form
FieldDescription
NameName of the assignment group.
ManagerGroup manager or lead.
TypeCategory for this group. In the Select target record field, search for OT to add it to the type field.
Group emailGroup email distribution list or the email address of the point of contact.
ParentOther group that the group is a member of.
DescriptionDescription of the assignment group.
  • \n Select Submit . \n

Now, the OT-specific assignment group is visible on the incident record.

Get the Reddit app

Subreddit for ServiceNow users, admins, devs, platform owners, CTOs and everything in between.

How to add multiple users to a assignment group in ServiceNow ?

No plain hardcoded userID scripting but want to do via catalog or flow designer so that selection of users is part of the UI, any idea please

By continuing, you agree to our User Agreement and acknowledge that you understand the Privacy Policy .

Enter the 6-digit code from your authenticator app

You’ve set up two-factor authentication for this account.

Enter a 6-digit backup code

Create your username and password.

Reddit is anonymous, so your username is what you’ll go by here. Choose wisely—because once you get a name, you can’t change it.

Reset your password

Enter your email address or username and we’ll send you a link to reset your password

Check your inbox

An email with a link to reset your password was sent to the email address associated with your account

Choose a Reddit account to continue

COMMENTS

  1. ServiceNow Advanced Reference Qualifier

    In this video, we add an advanced reference qualifier on a dictionary override on the assignment group fields (for incidents) that calls a server side script include to run some funky glideRecord queries and return as back a refined list of group sys_id's. Its then these groups that are shown when you click the Assignment Group magnifying glass.

  2. Configure the group type for assignment groups

    Loading... Loading...

  3. Configure group types for assignment groups

    Once defined, you can use these categories to filter assignment groups based on the group type using a reference qualifier. For example, when selecting an assignment group from the Incident form, Type can be used to filter groups based on whether they are typically involved in the Incident management process.

  4. Create filters or filter groups

    Loading... Loading...

  5. ServiceNow Advanced Reference Qualifier

    Been in a predicament in ServiceNow, where you know the person a task needs to be assigned to, but don't know the right group? I got you! In this video, we add an advanced reference qualifier on a ...

  6. Advanced Reference Qualifier Using a Script Include

    Using a Script Include means that the script only gets loaded and used when you actually need to use it! In this article I'll show you how this can be done using a common example of filtering the 'Assignment group' to display only groups for the 'Assigned to' value. The first piece is the 'Reference qual' field value on the ...

  7. servicenow

    I created a script in catalog task in workflow to find the location of the current user and find which assignment lookup rule should be use base on the location. But it's not working. var userloca...

  8. How to select only users of a specific group into a ...

    A customer had the requirement to restrict a field referencing sys_users to only list active users who are members of a specific group.

  9. ServiceNow

    ServiceNow

  10. Create a list of tickets that were once assigned to my group.

    A business rule populates this list field whenever the assignment changes. You can then run reports easily if you want to see all incidents that were at one point assigned to you or a particular group. You can use the metrics table to track assignment groups a ticket has been assigned to and duration in their queue.

  11. Assigned to and Assignment group

    Assigned to and Assignment group The Assigned to [assigned_to] field is a reference field type that points to the Users [sys_user] table. This field is generally used to designate a user to work on, or be responsible for the task.

  12. Calculation of duration based on assignment group

    Calculation of duration based on assignment group - Support and Troubleshooting - Now Support Portal. Calculate the duration of an incident based on the Assignment Group. Most of the cases, the incident will be traversed to multiple teams for resolution.

  13. Unable to filter by request_item.assignment_group? : r/servicenow

    It's one of the tricky things about the dot-walking bit. Keep the "requested item" expanded, but clear out your filter right above that (magnifying glass - request). The filter applies to all levels of the dot walk. We have a report on "My groups unassigned work," showing everything in the task table where assignment_group is "one of my groups ...

  14. Is there a way to filter incidents that were at some point assigned to

    We have been tasked with finding data from our Assignment group going back 3 years, but since the incidentes we receive often come from different groups, locations and have varying degrees of complete information, there is no reliable way to filter it.

  15. How to auto populate "Assignment Group" field present on ...

    The requirement is to auto-populate the "Assignment Group" field present on the 'sc_req_item" table

  16. Need help on reporting assigned to by group, not assignment group

    Need help on reporting assigned to by group, not assignment group. Recently switched from JIRA to ServiceNow and having a hard time reporting on groups of assignees without using Assignment Group. This is in ITSM. I have a large global team (140+) that each have multiple assignment groups based on Global and local support issues.

  17. Assigned to not clearing when Assignment group changes on ...

    The assigned to field is dependent on the assignment group. On the incident table the assigned to clears when the assignment group changes but this does not happen on other tables like sc_task.

  18. Missing request item assigned to specific assignment group while

    Please take note of the following points while integrating ServiceNow and IG for fulfillment: 1) Please modify the default Request Form in ServiceNow to have the Assignment Group visible. By default, it is not visible. The assignment will be showed if export the form to csv for pdf. ServiceNow admin will know how to accomplish this.

  19. Issues running a report/filter based on who assigned an inc to any

    There is an OOB metric to track assignment group changes that might help. Create a report on the incident_metric table. You could query the "sys_audit" table and find out which user changed the assignment group. Then, query the "sys_user_grmember" table to see if the user is a member of one of the groups you're looking for.

  20. Create an assignment group

    Loading... Loading...

  21. How to add multiple users to a assignment group in ServiceNow

    You'd need to put a collector variable on your catalog item in order to hold the values of the users you want to add. In your flow, you'll need to run script that queries the Group Has Member table and add a new record for each value input into the list collector variable. 2.