File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
Fix scripts/Mass Update RITM Variable Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change
1
+ //use this script to update a variable value on one or more RITM records
2
+ var ritm = new GlideRecord ( 'sc_req_item' ) ;
3
+ //ritm.addQuery... to return one or a subset of records
4
+ ritm . query ( ) ;
5
+ while ( ritm . next ( ) ) {
6
+ var mtom = new GlideRecord ( 'sc_item_option_mtom' ) ;
7
+ mtom . addQuery ( 'request_item' , ritm . sys_id . toString ( ) ) ;
8
+ mtom . addQuery ( 'sc_item_option.item_option_new' , '92bdf4be97857d189d0372e11153af08' ) ; //sys_id of a specific variable to update
9
+ mtom . query ( ) ;
10
+ if ( mtom . next ( ) ) {
11
+ var item = new GlideRecord ( 'sc_item_option' ) ;
12
+ item . addQuery ( 'sys_id' , mtom . sc_item_option . toString ( ) ) ;
13
+ item . query ( ) ;
14
+ if ( item . next ( ) ) {
15
+ item . value = '83d36f44974d71909d0372e11153af5f' ; //new value to be assigned, depending on variable type (reference type used here)
16
+ item . update ( ) ;
17
+ }
18
+ }
19
+ }
Original file line number Diff line number Diff line change
1
+ Use this Fix Script to update a variable value on one or more RITM records
You can’t perform that action at this time.
0 commit comments