- 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-20-2025 08:25 AM
HR case can be submitted by end users? So ideally not a good practice to use gs.getUserID()
Is that "Accept Assignment" a OOB button?
I couldn't see that on HR case table
If it's custom UI action then since you are directly assigning deactivate that button
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-20-2025 08:40 AM
Hi Ankur,
it is not about HR cases.
The agents use cases to communicate with customers.
The agent can click on button "Create Emergency Case" (in Agent Workspace) and the case should then be assigned to the agent without clicking "Accept Assignment".
Regards
Sirko
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2025 08:56 AM
if you don't want them to click "Accept Assignment" then why not disable that UI action?
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-20-2025 11:37 PM
Hi,
disabling the button will not let the agents accept the assignment, which is pre-requisite to show other buttons in the action bar for communicating with the customer, e.g. "Request Info" or "Propose Solution"
Regards
Sirko