- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2016 01:46 PM
Hi All,
I was trying to clone a RITM with all its variable what ever is entered . Like a clone button which creates a new RITM with all the variables. I am stuck with the copy of variables.
I heard their is OOB clone available in some discussions but did not pointed exactly what it do and how to use it.
Any help is appreciated .
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2016 02:03 PM
from Maintain Items > item > right click menu > Copy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2016 02:22 PM
Hi mrswann,
This is not catalog item.. i am looking for RITM copy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2016 02:34 PM
same thing AFAIK ?
sorry not in front of a machine so was going from memory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2016 04:47 PM
i have used the below logic to copy RITM in UI action on sc_req_item table
var gr = new GlideRecord('sc_req_item');
gr.initialize();
gr.request=current.request;
gr.request.requested_for=current.request.requested_for;
gr.cat_item=current.cat_item;
gr.cmdb_ci=current.cmdb_ci;
gr.short_description=current.short_description;
gr.description=current.description;
gr.insert();
var newRITM=gr.sys_id;
sc_item_option_mtom = new GlideRecord('sc_item_option_mtom');
sc_item_option_mtom.addQuery('request_item', current.sys_id);
sc_item_option_mtom.query();
while(sc_item_option_mtom.next()){
var sc_item_option = new GlideRecord('sc_item_option');
sc_item_option.addQuery('sys_id', sc_item_option_mtom.sc_item_option);
sc_item_option.query();
if(sc_item_option.next()){
var sc_item_option_insert = new GlideRecord('sc_item_option');
sc_item_option_insert.initialize();
sc_item_option_insert.item_option_new=sc_item_option.item_option_new;
sc_item_option_insert.value=sc_item_option.value;
sc_item_option_insert.insert();
var sc_item_option_mtom_insert = new GlideRecord('sc_item_option_mtom');
sc_item_option_mtom_insert.initialize();
sc_item_option_mtom_insert.request_item=newRITM;
sc_item_option_mtom_insert.sc_item_option=sc_item_option_insert.sys_id;
sc_item_option_mtom_insert.insert();
}
new Workflow().restartWorkflow(gr);
}