Linking Change Requests with SC Tasks M2M

nmsmtys
Tera Contributor

Hello all,
Can anyone help me how to achieve the following? I want to have a UI action on SC Task, and by clicking it, I want to be redirected to the sn_chg_model_ui_landing page, so I can select a change template, and once the change request record is saved, I want to create a record in an M2M table to link the Change with the SC Task. I can't seem to pass the sys_id of the SC Task via URL, as it needs another redirect to get to the change form from the template landing page.
Thanks in advance.

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@nmsmtys 

Can you share UI action script and screenshot?

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

The current UI action looks like this, but it uses custom fields (u_ritm on Change Request, and u_change_request on SC Task). We want to remove these custom fields, and implement M2M relationships instead.

var url = new GlideURL("sn_chg_model_ui_landing.do");
url.set("sys_id" , "-1");
url.set("sys_target" , "change_request");
url.set("sysparm_collection" , "sc_task");
url.set("sysparm_collectionID" , current.sys_id);
url.set("sysparm_collection_key" , "parent");
action.setRedirectURL(url.toString());
I couldn't find any documentation on what sysparm_collection, collectionID and collection_key does.

@nmsmtys 

in that case populate the parent field on CHG with that RITM so that RITM gets linked with CHG and the same can be used on SC Task as well

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

JDC
Tera Contributor

Hi nmsmtys,

Were you able to find a resolution?  If so, can you please share?  I have a similar issue.