GlideAjax - changes priority
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2023 06:16 AM
Hi, I would like to know why the code doesn't work for me? What I need to do is as soon as I open an incident and put in the caller a client who is a VIP, then the priority automatically changes to 1. This is important as soon as I open before I save , But this is the only way I need - GlideAjax I am attaching pictures of what I did but it doesn't work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2023 06:49 AM
Hi @yardenKrispel ,
U commented even the Glide Ajax call. I asked u to comment line 14-20. Can u please share the script here as in copy paste. I will provide u the script u just replace that n check
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2023 06:51 AM
yes this is the script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2023 06:56 AM
Please find the updated script
function onLoad() {
// Get the sys_id of the user associated with the incident
var userId = g_form.getValue('caller');
// Make a GlideAjax call to fetch the VIP field from the user record
getVIPStatus(userId);
}
function getVIPStatus(userId) {
var ga = new GlideAjax('MyGlideAjaxScriptInclude');
ga.addParam('sysparm_name', 'getVIPStatus');
ga.addParam('sysparm_sys_id', userId);
ga.getXMLAnswer(_handleResponse);
function _handleResponse(answer) {
alert(answer);
if (answer == 'true') {
// Additionally, set urgency, impact, and priority
g_form.setValue('urgency', '1');
g_form.setValue('impact', '1');
g_form.setValue('priority', '1');
}
}
}
Please try this Also change the "Impact" & "Urgency" field name to proper backend names from incident table
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2023 06:58 AM
yes i try this and is sstill dont work, mabay script includede? this is my code :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2023 06:59 AM
no change