How to Create Standard Change from RITM and relate ?

Amey8
Tera Guru

I have created a UI Action on the sc_req_item table and added the same code that I found in the UI Action for the Problem table for Creating a Standard Change:

action.setRedirectURL(new StdChangeUtils().getURLForTask(current, 'rfc'));


When this UI Action is clicked, it opens the list of all Standard Change templates. Upon selecting a template, a Change Request is created.

My Requirement:
I want the RITM (Requested Item) to be displayed in the Related Records section of the Change Request that is created from the Standard Change template.

I have implemented similar UI Actions for creating Normal Changes, where I use a different approach to link the RITM. However, that approach doesn't apply here, since this process first redirects to the Standard Change template selection page.

 

var change_id = changeRequest.insert();

current.parent = change_id;
current.u_change_request = change_id;
current.update();​


Question:
Is there a way to implement this functionality so that the originating RITM is linked to the Change Request created via the Standard Change template?

 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Amey8 

try this

var url = new StdChangeUtils().getURLForTask(current, 'rfc');
url += '&ritm_sys_id=' + current.sys_id;
action.setRedirectURL(url);

then use onLoad client script and try to get ritm_sys_id from URL and set it in parent field on CHG

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

6 REPLIES 6

@Amey8 

try with normal UI action and let them select the template and see using onload client script what comes in URL

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Amey8 

so let them select the template and see what comes in the URL and then parse and get the value.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader