- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 04:42 AM
I need to declare value of assignment group in 'Problem' Table.
And here is a problem, cause I just want to declare assignment group only for new records, while updating change of the assignment group should be possible.
That's how my client script look like :
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
if(g_form.isNewRecord()){
g_form.setValue('assignment_group', '6ae3f5b21b479850bf327bb5464bcb45');
}
}
After when I'm trying to create a Problem I've got message below assignment group field:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 04:48 AM
Hello,
I would suggest you to use a Business rule. create a before insert business rule and use the below code:-
current.setValue('assignment_group', '6ae3f5b21b479850bf327bb5464bcb45');
Please mark my answer as correct based on Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 04:53 AM - edited 09-27-2023 04:54 AM
Hi @DIVI1
Can you try using "Assignment Rule" instead of script.
Below link might help you...!!
Create assignment rule :
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 05:00 AM
Let me check 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 05:12 AM
I Can't see the option to specify condition - if is New Record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 05:19 AM - edited 09-27-2023 05:23 AM
Hi @DIVI1
Do you want to populate Assignment group automatically when you click on new button or while creating new record...??
If yes...then you can use set Default value for "Assignment group" by configuring dictionary (Make sure to use Dictionary override ...!!).
Default value = sys_id of group
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 05:23 AM
Look I wanted to get something like this, don't matter which assignment group user choose it's saved assigned to 'Problem Coordinators' but it should be possible to reassign for existing tickets.