Clear Assigned to value on change of Assignment Group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2020 06:56 AM
Hi,
After changing of Assignment Group" , Assigned to field should be clear. How can i achieve this with below scriptings.
1.Client Script
2.Business Rule
I tried Onchnage Client script but it is not working
- Labels:
-
Customer Service Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2020 06:58 AM
Hi there,
If this should happen onChange, then it's Client Side scripting. You could use a onChange client script (onChange of Assignment Group) for this, which simply applies something like:
g_form.setValue('assigned_to', '');
For some field types clearValue will also work, though from the top of my mind, this doesn't work for a reference field.
In some cases, when Assigned to is depending on Assignment group, it's already cleared.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2020 07:03 AM
i tried the same script but still it is not working..
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
g_form.setValue('assigned_to', '');
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2020 07:07 AM
Can you share some screenshots? For example it could be that the UI Type field is wrong. Is it onChange of Assignment Group?
You might also add some debugging, start your script with an alert of addInfoMessage, to see if your script got triggered. (or if you are familiar with using the console, console.log might help)
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2020 07:00 AM
Hi Lucky,
Apporach shared by Mark should work. In addition, can you share the onChange() client script that you created but did not work.