Assigning group when creating a ticket by VirtualAgent
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2025 10:38 AM
Hi,
I'm trying to make sure that all tickets opened by Virtual Agent will go to a Service Desk group.
I'm using create incident topic block and I can't get it to work.
Here is my script:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2025 01:27 PM - edited 03-06-2025 01:29 PM
Could you please use the following script instead: (Please add sys_id of service desk team)
var incident = new GlideRecord('incident');
incident.initialize();
incident.caller_id = vaInputs.caller;
incident.sys_created_by = vaInputs.caller;
incident.short_description = vaInputs.short_description;
incident.description = vaInputs.description;
incident.assignment_group = "SYS_ID_OF_SERVICE_DESK_ASSIGNMENT_GROUP";
incident.urgency = vaInputs.urgency;
incident.contact_type = 'virtual_agent';
incident.comments = vaInputs.comments;
//Keep track of this incident as a variable to use to display it
vaVars.inc_sysid = incident.insert();
//Link this incident to the Interaction
vaSystem.attachRecordToConversation('incident',vaVars.inc_sysid);
It should be placed within (function execute(){...})()
If you found this helpful, please hit the thumbs-up button and mark as correct. That helps others find their solutions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2025 08:28 AM
Thank you, but unfortunately it keep crashing (I'm having technical issues and won't be able to continue this conversation). Any other ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2025 10:43 AM
I have a script that almost works:
(function execute() {
var incGr = new GlideRecord('incident');
incGr.get(vaVars.inc_sysid);
incGr.assignment_group = "4546996d87a889102fb9400d0ebb35ab"; // Group sys_id
incGr.update(); // Update the record
})();
I use it as a topic block, and sometime it works as intended, and some time it crashes the main topic with "technical difficulties" error message. Any idea?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2025 11:24 AM
Hello @MaciejPletnia,
Please try:
(function execute() {
var incGr = new GlideRecord('incident');
if(incGr.get(vaVars.inc_sysid)){
incGr.assignment_group = "4546996d87a889102fb9400d0ebb35ab"; // Group sys_id
incGr.update(); // Update the record
}
})();
Since it is a record update, why not to use the Virtual Agent Utility Record Action:
If you found this helpful, please hit the thumbs-up button and mark as correct. That helps others find their solutions.