URL link need to add while task creation

tejaswini666
Tera Contributor

Hi,

 

I have created a schedule job which creates a task by using code below

.But now i want to pass URL link like if it is for test/prod, it should fetch current url and  then add this link to it. "currentUrl/sys_user_list.do?sysparm_query=roles%3Dadmin&sysparm_first_row=1&sysparm_view=" to the task description

var grtask = new GlideRecord('sc_task'); //create a task
grtask.initialize();
grtask.short_description = "Check privileged users";
grtask.description = "Hi Team, Please check privileged users";
grtask.assignment_group = "614a012edbfd5010019c6085059619f4";
grtask.insert();

 

1 REPLY 1

Varun Sharma
Tera Expert

Hi Tejaswini, 

 

you can use this code for client side 

// use this for client side : 

var currentURL = window.location.href;
gs.info("Current URL: " + currentURL);

// use this for server Side : 
var currentURL = gs.getRequest().getURL();
gs.info("Current URL: " + currentURL);

 

Hope it helps. 


Regards, 


Varun Sharma