- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2018 09:16 AM
Hi folks,
I recently inherited the Change Management module and was asked to add a couple new fields to the form. I added them without issue but when i attempt to copy the change request, all fields copy except for the ones i added....
original Change Request
New Change Request....
I found a UI Action called copy_change_request, that i believe will copy all the fields to the new CR. However I can't determine what in the code copies each of the form fields from the original to the new CR. I'm hoping someone can help me decipher the code and help me add the two new fields so they get picked up in the new CR. here is the code...
function OnCopyChangeClick() {
function addParam(form, name, val) {
var inp = cel('textarea', form);
inp.name = name;
inp.value = val;
}
var srcSysId = g_form.getUniqueValue();
var ga = new GlideAjax('ChangeUtils');
ga.addParam('sysparm_name', 'getChangeQueryParams');
ga.addParam('sysparm_src_sysid', srcSysId);
ga.setWantSessionMessages(true);
ga.getXMLAnswer(function (queryParam) {
if (queryParam) {
var gotoUrl = [];
gotoUrl.push('srcSysID=' + srcSysId);
gotoUrl.push('newSysID=$sys_id');
gotoUrl.push('sysparm_returned_action=$action');
gotoUrl = 'CopyChangeRelatedLists.do?' + gotoUrl.join('&');
var form = cel('form', document.body);
hide(form);
form.method = "POST";
form.action = g_form.getTableName() + ".do";
if (typeof g_ck != 'undefined' && g_ck != "")
addParam(form, 'sysparm_ck', g_ck);
addParam(form, 'sys_id', '-1');
addParam(form, 'sysparm_query', queryParam);
addParam(form, 'sysparm_goto_url', gotoUrl);
form.submit();
}
});
}
Thanks,
Robert
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2018 10:05 AM
Hi,
You need to look for sys_properties table. From Application navigator ( type sys_properties.list press enter) & then search for property
com.snc.change_request.copy.attributes
In the value field of the property mention the attribute that you want to be copied over when Copy Change is used.
Thanks,
Jaspal Singh
Hit Helpful or Correct on the impact of response.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2018 10:05 AM
Hi,
You need to look for sys_properties table. From Application navigator ( type sys_properties.list press enter) & then search for property
com.snc.change_request.copy.attributes
In the value field of the property mention the attribute that you want to be copied over when Copy Change is used.
Thanks,
Jaspal Singh
Hit Helpful or Correct on the impact of response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2018 10:50 AM
Thank you Jaspal, it worked perfectly!!