Show Related Incidents button

Mickey_Cegon
Tera Expert

I'd like to use the New Call screen for our Service Desk staff, but they need to be able to see whether or not there are open incident for a caller, from that screen. If they wait until they submit the incident, and then check the Show Related Incidents button, the new incident is already created. I added the attribute of ref_contributions=user_show_incidents to the u_requested_for field, but it doesn't work the same as adding the attribute to the caller_id field on the actual Incident form. Can I create a new macro that would work for the New Call screen?

Also, I'd like to have a way to see if there are any open incidents with the same Category as the one the tech chooses, on the main incident form, possibly on a Related List tab. Is this possible?

4 REPLIES 4

SimonMorris
ServiceNow Employee
ServiceNow Employee

Hi, Just to let you know that we had a crack at this today.

We fixed most of the issue in that we rewrote the Jelly script to pull the information correctly. We weren't able to associate that UI action to the caller_id field on the New Call wizard.

We'll keep at it, and will let you know!

Simon


chrishenson
ServiceNow Employee
ServiceNow Employee

Hello,

We've been looking at this today and created a couple of Wizard Client Scripts to do the job. One for the onLoad of the form and a second for the onChange of the caller field to manage display of the icon.

They replicate the incident lookup from the regular Incident form so should do everything you need.

I've attached the two Wizard Clients Scripts as XML for you to have a look at.

Chris


ctrusty
Kilo Contributor

I'm replying to add to the OP's original issue. So has it been determined that it is a bug that ref_contributions don't work in the Attributes field on wizard variables? I'm running into the same issue with a wizard trying to add a UI Macro to a Location field (so when it is clicked, it would launch a GlideDialogWindow to add a new location). I can't get the icon to display either.

I'm going to attempt the solutions above for OnLoad and OnChange to see if this will work for me.

Thanks!


ctrusty
Kilo Contributor

To add to your 2nd question Mickey, you can do an onChange client script that will query for any records where the Category & caller is the same, etc. I used a client script on a custom customer service application that does a look up for 'same issue' tickets by doing a lookup after the issue type & caller's phone number is captured. I have the information (and ticket #s found) displayed in a pop-up box.

Here is the wizard client script:



function onChange(control, oldValue, newValue, isLoading) {
if (!isLoading) {
if(newValue != '') {

// get values for caller / issue type from wizard
var mdn = g_form.getValue('caller_mdn');
var type = g_form.getValue('issue_type');
var msg = ' ';
var i = 0;

//Check for records with same mdn/issue type that are open
var gr = new GlideRecord("table_name");
gr.addQuery('u_customer_mdn', mdn);
gr.addQuery('u_customer_issue_type', type);
gr.orderBy('number');
gr.addQuery('active',true);
gr.query();

while(gr.next()){
// build list of active tickets with same issue for same caller
msg += gr.number + ", ";
i++;
}

if(i > 0){
alert("ERROR: MDN " + mdn + " already has tickets open for issue type " + type + ". Please refer to these ticket numbers: " + msg);
}
}
}
}


You could also do this onSubmit and prevent the record from being captured if desired.