- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-28-2020 08:22 AM
In our ServiceNow development environment I added a new column to our Change Request table called Rally Defect. It is a string field max 40 not mandatory and does not specify a choice list or a default value. In the development environment the field works as expected.
I promoted the update set in which this column was added to our test environment and it committed successfully. However all the records in our test environment that existed before adding the column now have the column present and it has a value of "1". New records created after adding the column have a blank value in the column as expected.
I don't know where the "1" value came from or how to undo it. I compared the column definition between our development environment and test environment and they look identical. Any ideas?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-29-2020 07:49 PM
Hello Kyle,
Without access to the instance, it is hard to debug on why this value got populated for existing records?(Business rule?). That said, to undo the changes you can create a fix script to remove the values for existing records in the change request table. Script for reference:
var changeGr = new GlideRecord('change_request');
changeGr.addQuery('u_rally_defect',1);
changeGr.query();
while(changeGr.next()){
changeGr.u_rally_defect = '';
changeGr.setWorkflow(false);
changeGr.autoSysFields(false);
changeGr.update();
}
- Pradeep Sharma

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-29-2020 07:49 PM
Hello Kyle,
Without access to the instance, it is hard to debug on why this value got populated for existing records?(Business rule?). That said, to undo the changes you can create a fix script to remove the values for existing records in the change request table. Script for reference:
var changeGr = new GlideRecord('change_request');
changeGr.addQuery('u_rally_defect',1);
changeGr.query();
while(changeGr.next()){
changeGr.u_rally_defect = '';
changeGr.setWorkflow(false);
changeGr.autoSysFields(false);
changeGr.update();
}
- Pradeep Sharma

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2020 06:00 AM
In addition to Pradeep's fix, you could begin to troubleshoot this issue by doing a code search across all applications in Code Studio for your new field name. There may be, as Pradeep mentioned, Business Rules, or some other process in play that caused the 1 to show up.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2020 09:47 AM
Thanks for the example script Pradeep, I'll use that to clean up our "test" environment where this occurred.
That field was not populated with "1" when I promoted the same update sets to our production environment. Not sure what caused it in our test environment.
-kyle

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2020 11:29 AM
Thanks for the update Kyle. Let me know if that answered your question. If so, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.
- Pradeep Sharma