- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2025 04:04 AM - edited 07-17-2025 06:09 AM
We have around 3000 RITMs but I need to move only 500 RITMs from one SN to another SN instance (including the variables and its values for 500 RITMs)
I used a filter to export those 500 RITM via XML and imported in target instance but the variables section did not show up on the RITM, and I understand the reason - that the variable data sits in different table which is sc_item_option.
Hence, I went to sc_item_option table to export the XMLs but problem is that, I couldnt find a way to use the filter on this table.. something like 'RITM is one of <1,2,3..500>' on this table.
Anyone knows how to export the variables and its values from sc_item_option table for those specific 500 RITMs?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2025 06:26 AM
Hi @Suggy ,
yes run the script in the source instance
you will get the sysids of the those variable and value records
goto those tables and filter the records using sysid is one of {out put sysids}
and then export them as xmls
do the same with sc_item_option_mtom
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2025 08:30 AM
Hello @Suggy ,
If you have list of RITM numbers then you can add the filter on the sc_item_option_mtom.LIST table as Parent.number is one of <RITM_numbers>.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2025 06:02 AM
HI @Suggy ,
Run this in the background script
add the encoded query with you encoded query in the 5th line to filter the 500 ritms (i have added active=true as a place holder replace it with yours)
i have added 4 gs.info statements
1st prints (sc_item_option)
2. prints sysids related to that table
3. prints (sc_item_option_mtom)
4. prints sysids related to that table
it will print sysids into the console
copy the sysids and go to respective tables and filter the list using sysid and export those records as xmls
var scItemOptionIDs = []
var scItemOptionMTOMIDs = []
var ritmGr = new GlideRecord('sc_req_item');
ritmGr.addEncodedQuery('active=true');//add your encoded query to filter those 500 ritms
ritmGr.query();
while (ritmGr.next()) {
var scItemMtomGr = new GlideRecord('sc_item_option_mtom');
scItemMtomGr.addQuery('request_item', ritmGr.getValue('sys_id'));
scItemMtomGr.query()
while (scItemMtomGr.next()) {
scItemOptionMTOMIDs.push(scItemMtomGr.getValue('sys_id'));
scItemOptionIDs.push(scItemMtomGr.getValue('sc_item_option'))
}
}
gs.info('sc_item_option')
gs.info(scItemOptionIDs)
gs.info('sc_item_option_mtom')
gs.info(scItemOptionMTOMIDs)
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2025 06:10 AM
@Chaitanya ILCR I dont want the output. I want the XML for variables and its values for those 500 RITMs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2025 06:26 AM
Hi @Suggy ,
yes run the script in the source instance
you will get the sysids of the those variable and value records
goto those tables and filter the records using sysid is one of {out put sysids}
and then export them as xmls
do the same with sc_item_option_mtom
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2025 12:17 AM
Hi @Suggy ,
Have you had a chance review my response?
if this make sense to you. could you please mark the response as helpful and accept it as a solution and close the thread
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya