Need to Populate Short description and description RITM variables on newly opened Change Request

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2020 05:14 AM
HI guys,
There are two variables on RITM, Short Description & Description. If we open the RITM, in the related lists there is Change Request tab. So once we go to that Change Request tab and click new, it will give 3 options Normal, Standard and Emergency. Whatever we select, the change request form gets open. Then in that Change form i want to populate Short Description and Description fields with the values of Short Description and Description of RITM variables. FOr that i have written a BR and its not working. Can someone correct my code plz
my BR:
Table: sc_req_item
after-->insert
Script:
var a = new GlideRecord('change_request');
a.initialize();
a.get(current.sys_id);
a.short_description = current.variables.short_description;
a.description = current.variables.description;
a.insert();
Regards,
Indup
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2020 09:04 AM
Hi,
I have updated your existing BR
var gr = new GlideRecord('change_request');
gr.initialize();
gr.u_requested_item = current.sys_id;
gr.short_description = current.variables.u_short_description;
gr.description = current.variables.u_description;
gr.insert();
I was not able to check how the New button is taking to the interceptor page
I created another BR before insert. check if that helps
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
‎12-04-2020 01:36 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2020 01:41 AM
Hi,
use this to get the variable values while forming the json
gr.variables.u_short_description.getDisplayValue()
gr.variables.u_description.getDisplayValue()
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
‎12-04-2020 01:52 AM
No Ankur,
I have given log message at SI side like
gs.log("SD is "+gr.variables.u_short_description.getDisplayValue());
this log message is not coming in the logs
Regards,
Indup
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2020 01:56 AM
Hi,
please check variable name is proper or not
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader