- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2024 01:06 AM
We have loads of email release incident tickets come into us from shared mailboxes which then get logged under the Guest caller. A lot of these tickets are getting closed under Guest which from a reporting point of view is not good. Would anyone have any idea for code for a client script to prevent incident records being set to resolved if the Caller field is still Guest? This is what I have so far 5136503cc611227c0183e96598c4f706 is the sys ID for our Guest account
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var caller_name = g_form.getValue(‘caller_id’);
if(caller_name == ‘5136503cc611227c0183e96598c4f706’){
g_form.setValue(‘state’, ” ”);
g_form.addInfoMessage(“An incident can not be resolved while Caller is set to Guest. Please get the original requestor's name”);
//}
//}
//Type appropriate comment here, and begin script below
}
Solved! Go to Solution.
- Labels:
-
Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2024 01:43 AM
Hi @lynchr02,
Whilst a Client Script or UI Policy will certainly help with the User Experience (UX), it's best to trap this at the server layer.
You may also want to consider not just Resolution, but also closure. See the below Business Rule to implement to take care of this for you.
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.
Thanks, Robbie
(function executeRule(current, previous /*null when async*/ ) {
gs.addInfoMessage("An incident can not be resolved while Caller is set to Guest. Please get the original requestor's name");
current.setAbortAction(true);
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2024 02:50 AM
Great - No worries at all @lynchr02. Happy Thursday ; )
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2024 02:23 AM - edited 08-08-2024 02:25 AM
Hi @lynchr02,
Have you checked (ticked) the 'Advanced' checkbox in the top right of the page as shown below?
Also don't forget to check the 'Insert' and 'Update' check boxes which is when you want the Business Rule to Trigger ; )
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2024 02:32 AM
Ah thank you just a tick box
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2024 02:42 AM
That has worked a treat thanks so much Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2024 02:50 AM
Great - No worries at all @lynchr02. Happy Thursday ; )
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.
Thanks, Robbie