How to call script include URL(argument) of link type
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2017 05:45 AM
PFB, screen shot. Coding I used in script Include. Here I am returning entire argument in script include as query parameter also populating dynamically based on logged in user. Please help me in resolving this. I am getting blank page.
Script Include :
var usr = gs.getUserID();
var terr;
var TTYPE;
var clu;
var Reg;
var gr = new GlideRecord('sys_user');
gr.addQuery('sys_id',usr);
gr.query();
if(gr.next())
{
terr=gr.u_territory;
clu=gr.u_cluster;
TTYPE = gr.u_location_type;
Reg = gr.u_region;
}
gs.log("ALL CLU******"+clu);
var url;
if(TTYPE=="Territory"){
url = '/incident_list.do?sysparm_query=opened_by.u_territory='+ terr;
//gs.setRedirect("/incident_list.do?sysparm_query=opened_by.u_territory="+terr);
}
else if(TTYPE=="Cluster"){
url = '/incident_list.do?sysparm_query=opened_by.u_cluster='+ clu;
// gs.setRedirect(url);
}
else if(TTYPE=="Region"){
url = '/incident_list.do?sysparm_query=opened_by.u_region='+ Reg;
// gs.setRedirect(url);
}
gs.log("ALL URL******"+url);
return url;
Thanks,
Bindu.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2017 05:51 AM
What does your final gs.log() report?
gs.log("ALL URL******"+url);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2017 05:58 AM
In Logs I am getting correct URL as expected based on logged in user.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2017 06:01 AM
Does your script include have the standard prototype construct similar to sample1 or did you put your code wrapped in a function in sample2?
// sample1
var myConditionCheck = Class.create();
myConditionCheck.prototype = {
initialize: function() {
},
type: 'myConditionCheck'
};
//sample2
function myCode() {
// my code here
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2017 09:47 PM
It is like sample 2