Script to Update Variables in Requested Items

kshaw
Giga Guru

I have a series of requested items that have 5 variables I need to update. The variables (agent names) are all of the Lookup Select Box type and originally were referencing the Group Member table. Now they are referencing the User table.

Now all requested item records show sys_ids for all the variables due to change from group member table to user table. Variable value is a valid sys_id but each variable needs to be touched to reassign it to the correct (same) user as originally entered. There are too many records to do this manually.

I need a script that will look at all records in the sc_req_item table, narrow it down to a specific catalog (or catalog category), get the current values (sys_ids) of the agents from the variables and resave them into the variable which will now pick up the correct agent from the filtered (by assignment group) list of users (not group members).

  1. open RITM
  2. if filter on catalog/catalog category
  3. for each of X variables, get current variable value, record it back (not sure if I need an intermediary step to record a different value first)
  4. update RITM record
  5. go to next RITM (~6000 records)

Here's a screenshot showing 2 of the filtered pulldowns. Old value (from gr member table) is the sys_id. It does match to one of the names in the list which is now coming from the User table filtered by assignment group.

Just can't wrap my head around the scripting required for this and all help is graciously appreciated.

1 REPLY 1

Harish KM
Kilo Patron
Kilo Patron

HI cant see the image. Can you attach it?

Regards
Harish