Questions about GlideappWizardIntercept(path).get()

DamianoG
Tera Contributor
Hi everybody,
 
I'm trying to learn more about GlideappWizardIntercept, and where i can find any information about it in my instance. The instance says that there isn't any definition  for GlideappWizardIntercept.
 
I have a UI action that creates a new problem task. When you press the Ui action, first goes on and interceptor and then it opens a problem task with some pre-edited text, like the type of problem task.
 
var uri = action.getGlideURI();
var path = uri.getFileFromPath() + '';
path = path.substring(0, path.length - 5) + '.do';

 

uri.set('sys_id', '-1');

 

path = checkWizard(uri, path);

 

if (path)
   action.setRedirectURL(uri.toString(path));

 

action.setNoPop(true);

 

function checkWizard(uri, path) {
   var already = uri.get('WIZARD:action');
   if (already == 'follow')
   return null;
   
   var wizID = new GlideappWizardIntercept(path).get();
   if (!wizID)
      return path;
   
   uri.set('sysparm_parent', wizID);
   uri.deleteParmameter('sysparm_referring_url');
   uri.deleteMatchingParameter('sysparm_list_');
   uri.deleteMatchingParameter('sysparm_record_');
   uri.deleteParmameter('sys_is_list');
   uri.deleteParmameter('sys_is_related_list');
   uri.deleteParmameter('sys_submitted');
   uri.deleteParmameter('sysparm_checked_items');
   uri.deleteParmameter('sysparm_ref_list_query');
   uri.deleteParmameter('sysparm_current_row');
 
   uri.set('sysparm_referring_url', uri.toString());
   uri.deleteMatchingParameter('fancy.');
   uri.deleteMatchingParameter('sys_rownum');
   uri.deleteMatchingParameter('sysparm_encoded');
   uri.deleteMatchingParameter('sysparm_query_encoded');
   uri.deleteParmameter('sysparm_refer');

 

   return 'wizard_view.do';
}
 
From what i can understand, the interceptor gets selected based on what gets set in  "uri.set('sysparm_parent', wizID);" My customer need to have another one similar, but with different choices.
 
wizID is given by GlideappWizardIntercept(path).get();  This method returns a sys id, and than is set with uri.set('sysparm_parent', wizID);
 
As i said, I wanted to see the definiton to understand how to add a new sys id for my UI action, but I can't search for that definition. GlideappWizardIntercept is not Bold like the other methods, and If I try to search for the definition of GlideappWizardIntercept, my instance says that there isn0t any definition about that.
 
Can somebody give me a hand, please?
 
Thanks in advance.
1 ACCEPTED SOLUTION

I'm not entirely sure what you're asking. If the Root Cause Analysis answer is not useful, you can set it to Inactive:

 

SheldonSwift_0-1737912811653.png

 

If you need to keep the OOB Problem Task interceptor and want to create a new one, you can try to specify the sys_id of the wizard you want to use. Just replace path with the sys_id of your interceptor like this:

 

   var wizID = new GlideappWizardIntercept('29f12894534823004247ddeeff7b1222').get();

 

View solution in original post

6 REPLIES 6

Sheldon  Swift
ServiceNow Employee
ServiceNow Employee

Hi @DamianoG - The path is matched against the intercepts field of records in the sys_wizard table. If a match is found, .get() returns the sys_id of the matching record; otherwise, .get() returns null.

 

For example:

var wizID = new GlideappWizardIntercept('sys_notification_action.do').get();

wizID will be the sys_id of this record: /sys_wizard_list.do?sysparm_query=intercepts%3Dsys_notification_action.do

Hi @Sheldon  Swift , Thanks for the answer.

But now I have a doubt. Is there a way to specify more the intercept? I mean, if I have two matches, how can i select the one i need?

 

Basically, They asked me to make a new ui action, to create problem task from the related list of the problem.

I need to copy to one we already have available. They want to make it appear like the image here, but only the "General" line.

Question Interceptor.png

 

If I use 

var wizID = new GlideappWizardIntercept('problem_task.do').get();

How can i select the correct intercept?

Because I think that if i use the method above, the system will find two matches for problem_task.do; the one of the attachment, and the one I'm going to create.

 

Hope I've been clear

 

Thanks again

 

What happens if you hardcode wizID? If that works, you can just create a system property to hold that sys_id.

@Sheldon  Swift  Sorry for my inexperience, but in what way I can put the hardcoded wizID in the script I've put in my first message?

 

Will the system be able to fill the problem field, so that the problem task is linked to the correct problem?