- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2025 08:10 AM
Hi,
I'm creating a new case and assign it to an Agent using
var newCase = new GlideRecord('sn_customerservice_case');
newCase.initialize();
newCase.assigned_to = gs.getUserID();
newCase.insert()
but the Agent must click "Accept Assignment".
How can I avoid that?
The Case should directly be assigned to the agent.
Best Regards
Sirko Fresia
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2025 02:02 AM - edited 03-21-2025 02:03 AM
Ok, I found the solution:
The state must be set to "open", then the assignment is accepted.
var newCase = new GlideRecord('sn_customerservice_case');
newCase.initialize();
newCase.assigned_to = gs.getUserID();
newCase.state = 10;
newCase.insert();
Regards
Sirko
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2025 12:34 AM
what happens currently when they click Accept Assignment?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2025 02:02 AM - edited 03-21-2025 02:03 AM
Ok, I found the solution:
The state must be set to "open", then the assignment is accepted.
var newCase = new GlideRecord('sn_customerservice_case');
newCase.initialize();
newCase.assigned_to = gs.getUserID();
newCase.state = 10;
newCase.insert();
Regards
Sirko