JournalRedactor - Easily Redact or Delete Journal Entries in ServiceNow!
After being asked how to remove information from, or delete, a journal entry three times in as many days, I finally decided to get off my butt, and write this tool. Then I realized that it's difficult to code standing up, so I sat down back on my butt, and got to work.
If you've ever tried to modify or delete a journal entry, you probably already know what an ordeal it can be, and you've likely sunk hours into the attempt, if not thrown your hands up in frustration altogether! There are at least four distinct tables involved in modifying/redacting or deleting a journal entry, each with a unique schema, some dependent on others, and some stand-alone:
- Journal Entry [sys_journal_field]
- Audit [sys_audit]
- History Set [sys_history_set]
- History line [sys_history_line]
"Why the hell is this so complicated?" would not be an unreasonable question to ask, but each of these tables actually does serve a unique and valuable purpose. The difficult part (once you've identified all of the tables a journal entry's data might reside in), is identifying how they all work together. Then you have to actually locate the record in each table that corresponds to the specific journal entry you want to redact, and modify it in some way (which may be different depending on what you're trying to do, and what table you're interacting with.
Or - you could simply grab the tool I've just written, and use that instead.
The tool is simply a Script Include, which you can see the complete contents of (as of v1.1) in this Gist. You can find the download link and complete API documentation by going to the Tools menu at the top of this page, and clicking JournalRedactor, or by clicking here.
Once JournalRedactor is installed in your instance, you can redact or delete a journal entry in a few ways - most commonly, the following:
var targetRecordID = '1c741bd70b2322007518478d83673af3'; var oldJournalText = 'customer social is 123-45-6789'; var redactor = new JournalRedactor();
redactor.findJournalID(targetRecordID, oldJournalText);
redactor.redact(false, '[REDACTED]');
See the complete API documentation for more info and usage examples, or post a comment below if you have any questions!
- March 2024
- February 2024
- Feb 12, 2024 5 Lessons About Programming From Richard Feynman Feb 12, 2024
- July 2023
- May 2023
- April 2023
- December 2022
- Dec 13, 2022 ServiceNow Developers: BE THE GUIDE! Dec 13, 2022
- October 2022
- August 2022
- March 2022
- February 2022
- May 2021
- April 2021
- February 2021
- November 2020
- Nov 17, 2020 SN Guys is now part of Jahnel Group! Nov 17, 2020
- September 2020
- July 2020
- January 2020
- Jan 20, 2020 Getting Help from the ServiceNow Community Jan 20, 2020
- December 2019
- November 2019
- April 2019
- March 2019
- February 2019
- Feb 27, 2019 Making Update Sets Smarter - Free Tool Feb 27, 2019
- November 2018
- October 2018
- September 2018
- July 2018
- Jul 23, 2018 Admin Duty Separation with a Single Account Jul 23, 2018
- June 2018
- May 2018
- May 29, 2018 Learning ServiceNow: Second Edition! May 29, 2018
- April 2018
- March 2018
- February 2018
- Feb 11, 2018 We have a new book! Feb 11, 2018
- November 2017
- September 2017
- Sep 12, 2017 Handling TimeZones in ServiceNow (TimeZoneUtil) Sep 12, 2017
- July 2017
- June 2017
- May 2017
- April 2017
- March 2017
- Mar 12, 2017 reCAPTCHA in ServiceNow CMS/Service Portal Mar 12, 2017
- December 2016
- November 2016
- Nov 10, 2016 Chrome Extension: Load in ServiceNow Frame Nov 10, 2016
- September 2016
- July 2016
- May 2016
- May 17, 2016 What's New in Helsinki? May 17, 2016
- April 2016
- March 2016
- February 2016
- January 2016
- Jan 29, 2016 A Better, One-Click Approval Jan 29, 2016
- Jan 25, 2016 Quickly Move Changes Between Update Sets Jan 25, 2016
- Jan 20, 2016 Customize the Reference Icon Pop-up Jan 20, 2016
- Jan 7, 2016 ServiceNow: Geneva & UI16 - What's new Jan 7, 2016
- Jan 4, 2016 Detect/Prevent Update Set Conflicts Before They Happen Jan 4, 2016
- Jan 29, 2016 A Better, One-Click Approval Jan 29, 2016
- December 2015
- Dec 28, 2015 SN101: Boolean logic and ServiceNow's Condition Builder Dec 28, 2015
- Dec 17, 2015 Locate any record in any table, by sys_id in ServiceNow Dec 17, 2015
- Dec 16, 2015 Detecting Duplicate Records with GlideAggregate Dec 16, 2015
- Dec 11, 2015 Array.indexOf() not working in ServiceNow - Solution! Dec 11, 2015
- Dec 2, 2015 Understanding Dynamic Filters & Checking a Record Against a Filter Using GlideFilter Dec 2, 2015
- Dec 28, 2015 SN101: Boolean logic and ServiceNow's Condition Builder Dec 28, 2015
- October 2015
- August 2015
- Aug 27, 2015 Easily Clone One User's Access to Another User Aug 27, 2015
Advanced users who already know a fair bit about the REST API Explorer: Skip to 8:48 for the exact info you're looking for!
This video walks you through how to access catalog or record producer variables from ServiceNow via the REST table API, with minimal fuss.
https://snprotips.com/blog/2018/9/7/new-free-tool-journalredactor-easily-redact-or-delete-journal-entries-in-servicenow