Agent Workspace: UI Action to Change Interceptor?

Community Alums
Not applicable

In Agent Workspace when we click Create Change Request, we would like to be brought to the Change Request Interceptor. 

find_real_file.png

This is the UI Action I have but nothing happens when I click Create Change Request from that menu. 

find_real_file.png

What do I need to change to get it to work? 

1 ACCEPTED SOLUTION

Here i have tested on my personal instance and working fine. 

 

find_real_file.png

 

Script include:

 

var getUrlSio = Class.create();
getUrlSio.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {

	getURL: function(){
		var id = gs.getProperty("glide.servlet.uri");
		var url = id+'wizard_view.do?sys_target=&sysparm_wizardAction=sysverb_new&sysparm_parent=8db4a378c611227401b96457a060e0f4';
		return url;
	},

	type: 'getUrlSio'
});

 

UI Action Script:

 

function onClick(g_form) {
	alert('hey');
	var ga = new GlideAjax('sn_itsm_workspace.getUrlSio');
	ga.addParam('sysparm_name', 'getURL');
	ga.getXML(HelloWorldParse);

	function HelloWorldParse(response) {
		var answer = response.responseXML.documentElement.getAttribute("answer");
		//alert(answer);

		var win = top.window.open(answer, '_blank');
		win.focus();
	}



}

 

 

If my answer helped you, kindly mark it as correct and helpful.

 

View solution in original post

19 REPLIES 19

Hi @Harsh Vardhan ,

I tried this solution in a Workspace related list UI action, but I’m unable to pass the parent record's sys_id correctly.

Here's the code I used:

var id = gs.getProperty("glide.servlet.uri");
		var url = id+'wizard_view.do?sys_target=&sysparm_wizardAction=sysverb_new&sysparm_parent=cc4c6ada53dea6905c2a1ab0a0490efc';

 

In the above code, I’m using sysparm_parent to pass the interceptor's sys_id, but as per my understanding, sysparm_parent is usually meant for passing the record that acts as the parent (e.g. a Due Diligence request or Vendor record).

Could someone please help clarify:

  • What is the correct way to pass both the interceptor sys_id and the parent record sys_id?

  • How do we make this work properly in Workspace (especially from a related list UI action)?

Thank you

Hii @Harsh Vardhan ,
I’m currently using a custom Declarative Action in Vendor Management Workspace to launch a wizard/interceptor.
The navigation is working fine, it successfully redirects to the interceptor using the code below:
However, I’m unable to pass the parent record details to the interceptor to prepopulate fields like vendor, engagement, or applies_to.

getURL: function(){

	var interceptorSysId = 'cc4c6ada53dea6905c2a1ab0a0490efc';
	var parentSysId = this.getParameter('sysparm_sysId'); 

	var id = gs.getProperty("glide.servlet.uri");
	
	var parentGR = new GlideRecord('sn_tprm_dd_request');
    if (!parentGR.get(parentSysId)) return '';

    var query = 'vendor=' + parentGR.vendor + '^engagement=' + parentGR.engagement + '^applies_to=engagement';
    var encodedQuery = encodeURIComponent(query);


	var url = id+'wizard_view.do?sys_target=&sysparm_wizardAction=sysverb_new&sysparm_parent='+interceptorSysId+'&sysparm_query=' + encodedQuery+
	'&wiz_collection=sn_tprm_dd_request' +
    '&wiz_collectionID=' + parentSysId +
    '&wiz_collection_key=parent';


Any advice or working examples would be much appreciated.

Thank you

Regards,
Keshav

 

 

Quick Demo

 

Its working

 

find_real_file.png

 

If my answer helped you, kindly mark it as correct and helpful.

@Harsh Vardhan   , This opens up the URL in the new window. I am trying to create a UI Action on the RITM table I want to related the RITM and change request. If it is created in new window , Can it be related ? what else can we try ?

Kim Sullivan
Tera Guru

Anyone ever find out how to do this, but keep the experience in Workspace.  Like the OOB Create Change Request button?