Create Standard Change from RITM and set Change parent as RITM reference

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2025 02:50 PM
Hello Everyone,
I'm having a requirement to Create Standard Change from RITM and set Change parent as RITM reference.
I did created below UI action which takes me to the standard change templates landing page,
var url = new StdChangeUtils().getURLForTask(current, 'rfc');
url += '&ritm_sys_id=' + current.sys_id;
action.setRedirectURL(url);
In this script, i am injecting ritm_sys_id into the URL and trying extract it & populate the parent field on the change form with the RITM reference.
However the below onLoad client script is not working as expected. Any suggestion/advice are welcome.
if (!gForm.isNewRecord()) return;
try {
var fullUrl = window.location.href;
var match = fullUrl.match(/[?&]ritm_sys_id=([0-9a-f]{32})/);
if (match && match[1]) {
var ritmSysId = match[1];
gForm.setValue('parent', ritmSysId);
}
} catch (e) {
console.error('Error extracting ritm_sys_id:', e);
}
Thanks in advance.
Best Regards,
Arun

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2025 10:03 PM
Instead of using regex to match the value, try the GlideURL API with the getParam method.
var url = new GlideURL(window.location.href);
var myParam = url.getParam('sys_myParameter');