- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2016 06:24 PM
I'm working with Tampermonkey within Chrome to automate a ticket route based on keywords found in the Short Description when submitted by an end user.
A lot of these self submitted tickets for access can be auto routed, I'm attempting to create a script that fills out the ticket and prompts either Yes or No if the technician would like to route the ticket to the resolver group input by the script.
I've currently got the code to read in the short description, find the keyword based on an array, set the index of that array to match with other arrays used to set Category, Subcategory, Subcategory Type, and Configuration Item.
When I try to use g_form.setValue() function or "document.getElementById('id').value =" it will input the data both into the work notes and into the Resolver Field, but when I hit save, it doesn't save these fields and takes it right back to the default (Service Desk resolver and no work notes).
Does anyone know a way to set the resolver group from a Tampermonkey JavaScript perspective?
Edit:
I found a log in the console, but still have no idea why this is occurring. I'm by all means a newbie when it comes to coding and especially understanding AJAX.
Error:
" ** WARNING *** GlideAjax.getXMLWait - synchronous function - processor: AJAXGlideRecord"
I'm not sure what this error means but from what I've researched it look like a timeout error when communicating with server, but even when I try to put the function through a setTimeout() function for Javascript to adjust for latency (like I had to do for Categorization) it still won't work.
Any help or thoughts is helpful.
Edit 2:
I was able to solve the Resolver Group issue as I was inputting incorrect data (thank you to notes below for helping me find this information).
Now the issue is that Work Notes won't save.
Work Notes are input into the ticket and when I hit save, they simply disappear and don't actually save to the ticket.
I'm using gel or document.getElemenyById("id").value +=
for this, but it's not saving correctly. Should I be using g_form?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2016 09:05 AM
g_form.setValue('assignment_group', 'this should be the sys id of group', 'this should be the display value of group');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2016 09:28 AM
I don't think this is a valid variable 'sys_display.sc_task.assignment_group'. This should be the sys id of the group.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2016 09:35 AM
Thank you for all your help!
So I ran:
var value = result_Array_Resolver[index];
var sys_id = g_form.getUniqueValue();
g_form.setValue('assignment_group', sys_id, value);
This still produces the same results and errors
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2016 09:38 AM
I believe this getUniqueValue() function returns the sysId, but I'm not sure how to find the sys_ID of that exact form/field.
Inspect Element shows the name and ID as the first answer I gave with the sys_display.sc_task.assignment_group