How to automate assignment group for a ticket creation related to Hardware issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2024 07:29 PM
Hi Everyone,
Can someone advise on how can I create a workflow in Virtual Agent designer for an incident ticket related to hardware which will be auto-assigned to Local IT based on user profile.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2024 10:59 AM - edited 05-15-2024 11:03 AM
@DeepanS Seems to the same post by you : https://www.servicenow.com/community/developer-forum/auto-assigned-a-ticket-created-in-virtual-agent...
I tried to replicate your issue and below is the guideline for further configurations.
1. Getting the inputs of Contact Number, Description and the Confirmation on location tagged to the user profile.
2. If the current location is "Yes", retrieve the user location from the "User" table and the managed by group from "Location" table. So the incident is created and assigned to the "Service Desk - L1" (i.e., automatic routing to local IT)
Note: "Managed by group" details needs to be filled without fail else the ticket will stranded. In that case you can enhance the flow to validate before proceeding further.
Create a script variable to capture the managed by details : vaVars.managed_by [used in below script]
Script of node : Retrieve user location and managed by
(function execute() {
/* Code your scripted action here. For example, you might update a
record based on conditional logic: */
var details;
var user_loc = new GlideRecord('sys_user');
user_loc.addQuery('sys_id', vaInputs.user);
user_loc.query();
while(user_loc.next()){
details = user_loc.getValue('location');
}
var managedByGrp = new GlideRecord('cmn_location');
managedByGrp.addQuery('sys_id', details);
managedByGrp.query();
while(managedByGrp.next()){
vaVars.managed_by = managedByGrp.getValue('managed_by_group');
return vaVars.managed_by;
}
})()
Creation of the record utility:
Result : Use card entity to display the incident details
3. If the current location is "No", create an incident and set it to a default group (i.e., Hardware for testing)
Creation of the record utility:
Result : Use card entity to display the incident details
Please mark this as helpful and "Accept" it as a solution if this resolves your query.
Thanks,
Sujatha V.M.
Sujatha V.M.