- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2021 04:09 AM
Hi All,
I need to have Copy Change button on Agent Workspace same as we have on native view. We have OOB "Copy Change" UI action.
I have checked "Workspace form button" checkbox. I can see Copy Change button on Agent Workspace but not performing any action. Please help me with this.
Thanks,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2021 02:51 AM
it got created from script only
then just show some alert to user with the CHG number
Client Script:
function onClick(g_form) {
//alert('1');
// GlideAjax here send the current CHG sys_id so that you can copy the fields to new CHG
var srcSysId = g_form.getUniqueValue();
var ga = new GlideAjax('CustomChangeUtils');
ga.addParam('sysparm_name', 'getChangeDetails');
ga.addParam('sysparm_src_sysid', srcSysId);
ga.getXMLAnswer(function(answer) {
alert(answer);
});
}
Script Include:
var ChgSysID = this.getParameter("sysparm_src_sysid");
var gr = new GlideRecord("change_request");
gr.addQuery('sys_id', ChgSysID);
gr.query();
if(gr.next()){
var gr1 = new GlideRecord('change_request');
gr1.initialize();
gr1.category = gr.category;
gr1.business_service = gr.business_service;
gr1.cmdb_ci = gr.cmdb_ci;
gr1.insert();
return 'CHG created ' + gr1.number;
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2021 02:15 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2021 10:51 PM
Hi
I did the same,Copy Change button is showing there but not doing anything.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2021 11:12 PM
you need to place the script in the Workspace client script
Copy the script from Script section to the Workspace client script and then check once
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2021 03:42 AM