Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Fix Scripts to transform data

JulietD
Mega Guru

Hi,

I have moved data from one instance A to the parent classes of another instance B. Now I need to move data from parent classes to child classes in Instance B.

In instance B, I can identify the data's from instance A, using a specific field.

My question is by using fix scripts, how to transform data's?

How is Reclassification using here?

Thanks

1 ACCEPTED SOLUTION

jcmings
Mega Sage

It's hard to understand what you are asking because there isn't a lot of detail. Do you need to add values into the parent field? Is this something that could be achieved in a transform map? 

View solution in original post

5 REPLIES 5

jcmings
Mega Sage

It's hard to understand what you are asking because there isn't a lot of detail. Do you need to add values into the parent field? Is this something that could be achieved in a transform map? 

Hi, 

My question is, As part of data migration, i moved datas to parent classes. Now i need to move those datas to child classes. how to move datas from parent class to child classes using fix scripts?

How is the parent/child relationship established? Is having the field "parent" on a record enough to mark something as a child case? (What table are you on?) 

 

Simply put, you could achieve this in a fix script by doing something like this...

var gr = new GlideRecord('table'); //add your table here
gr.addEncodedQuery('fieldISNOTEMPTY'); //adding in your identifier field in place of 'field'
gr.addEncodedQuery('sys_id=xxx'); //adding in one specific record for testing purposes; you can comment this line out after
gr.query();
while (gr.next()) {
//inside of this while loop, we will make the change that marks every record as a child
//but i do not know what that change is unless you can provide more details
//and then update the record
gr.update();
}

Need to move data from server class to windows and linux server classes