Prevent incidents being resolved while logged as Guest

lynchr02
Tera Contributor

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

}

2 ACCEPTED SOLUTIONS

Robbie
Kilo Patron
Kilo Patron

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

 

Screenshot 2024-08-08 at 09.42.33.pngScreenshot 2024-08-08 at 09.42.42.png

 

(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);

View solution in original post

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

View solution in original post

8 REPLIES 8

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

 

Screenshot 2024-08-08 at 10.21.32.png

lynchr02
Tera Contributor

Ah thank you just a tick box 

lynchr02
Tera Contributor

That has worked a treat thanks so much Robbie 

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