URL link need to add while task creation
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2023 02:53 AM
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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2023 04:35 AM
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