- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 09:11 PM
On incident form, populate the assignment group automatically when category is selected.
How to clearValue of assignment group field when category is None. using client script.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (newValue === '') {
g_form.clearValue('assignment_group');
}
g_form.setValue('assignment_group', '019ad92ec7230010393d265c95c260dd');
}
What changes I need to make so that assignment group field value is clear when selected category is none in incident table
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 09:45 PM
Hi @pk16514 Create a onchange client script on field "Category" and add the below script as per screenshot
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 09:57 PM
Thanks @Harish KM but it did not work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 10:00 PM
Hi @Harish KM ...sorry I forgot to put return...it's working now. Thanks a lot.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 10:00 PM
Hi @pk16514,
I would suggests to use the Assignment rules with conditions instead of writing client scripts for the same.
If my response helps you resolve your issue. Kindly mark it as helpful & correct. It will be helpful to future readers! 👍🏻
Thanks,
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2024 04:03 AM
Hi @pk16514
NOt sure why you write the code, this can be done via Looks up /.assignment rules very easily.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************