- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2023 11:56 AM - edited 03-20-2023 02:10 PM
Hi,
I want to create a fix script to update 2 empty fields "u_primary_contact_number" and "u_resolution_method"(see attachment) with "N/A" in 1000+ incident records. I am not proficient in scripting. thanks
Update - I tried the proposed fix script below but it didn't not working
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2023 12:38 PM - edited 03-20-2023 12:57 PM
Hi @Sam M3
Follow these step to write your script to update the records.
1. Go to the incident list view of records and filter the record "Primary_number is Emplty" and "Resolution is empty".
2. Run the filter then Right Click on the Query and Select "Copy Query".
3. Write the FIX Script as follow. (Replace Encoded query with copied query).
4. In the Application Navigator, Navigate to System Definition->Fix Script.
5. Create a New record
6. Click on the RUN FIX SCRIPT, You should be good to go.
Regards,
Ashir Waheed

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2023 12:33 PM - edited 03-20-2023 12:40 PM
Hi SAM,
You can try something like this. You can use any query you want to filter the record and change the name of table as needed.
var gr = new GlideRecord('incident');
gr.addQuery();
gr.query();
while(gr.next()){
gr.caller_id = gs.getUserID();
gr.primary_number = "N/A";
gr.resolution = "N/A";
gr.update();
}
Mark Correct and Helpful if it helps.
***Mark Correct or Helpful if it helps.***

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2023 12:38 PM - edited 03-20-2023 12:57 PM
Hi @Sam M3
Follow these step to write your script to update the records.
1. Go to the incident list view of records and filter the record "Primary_number is Emplty" and "Resolution is empty".
2. Run the filter then Right Click on the Query and Select "Copy Query".
3. Write the FIX Script as follow. (Replace Encoded query with copied query).
4. In the Application Navigator, Navigate to System Definition->Fix Script.
5. Create a New record
6. Click on the RUN FIX SCRIPT, You should be good to go.
Regards,
Ashir Waheed