snprotips.com Open in urlscan Pro
198.49.23.144  Public Scan

Submitted URL: https://redact.snc.guru/
Effective URL: https://snprotips.com/blog/2018/9/7/new-free-tool-journalredactor-easily-redact-or-delete-journal-entries-in-servicenow
Submission: On June 12 via api from US — Scanned from DE

Form analysis 7 forms found in the DOM

POST

<form class="newsletter-form" data-form-id="5b947c2521c67c935cbc86a7" autocomplete="on" method="POST" novalidate="" onsubmit="return (function (form) {
    Y.use('squarespace-form-submit', 'node', function usingFormSubmit(Y) {
      (new Y.Squarespace.FormSubmit(form)).submit({
        formId: '5b947c2521c67c935cbc86a7',
        collectionId: '56788ca9d08d9279f2a3afb0',
        objectName: 'item-5b92c474f950b758a9a6c77d'
      });
    });
    return false;
  })(this);">
  <header class="newsletter-form-header">
    <h2 class="newsletter-form-header-title">Subscribe</h2>
    <div class="newsletter-form-header-description">
      <p>Sign up with your email address to receive news and updates.</p>
    </div>
  </header>
  <div class="newsletter-form-body">
    <div class="newsletter-form-fields-wrapper form-fields" style="vertical-align: middle;">
      <div id="email-yui_3_17_2_1_1536433391865_21655" class="newsletter-form-field-wrapper form-item field email required" style="vertical-align: bottom;">
        <label class="newsletter-form-field-label title" for="email-yui_3_17_2_1_1536433391865_21655-field">Email Address</label>
        <input id="email-yui_3_17_2_1_1536433391865_21655-field" class="newsletter-form-field-element field-element" name="email" x-autocompletetype="email" autocomplete="email" type="email" spellcheck="false" placeholder="Email Address">
      </div>
    </div>
    <div data-animation-role="button" class="newsletter-form-button-wrapper submit-wrapper" style="vertical-align: middle;">
      <button class="
            newsletter-form-button
            sqs-system-button
            sqs-editable-button-layout
            sqs-editable-button-style
            sqs-editable-button-shape
            sqs-button-element--primary
          " type="submit" value="Sign Up">
        <span class="newsletter-form-spinner sqs-spin light large"></span>
        <span class="newsletter-form-button-label">Sign Up</span>
        <span class="newsletter-form-button-icon"></span>
      </button>
    </div>
    <div class="captcha-container sqs-form-rendered
          align-left
          
          
          " data-theme="light"></div>
  </div>
  <div class="newsletter-form-footnote">
    <p>We respect your privacy.</p>
  </div>
  <div class="hidden form-submission-text">Thank you!</div>
  <div class="hidden form-submission-html" data-submission-html=""></div>
</form>

POST #

<form action="#" method="post" class="comment-form">
  <textarea class="comment-input" name="comment" data-defaulttext="Leave a comment here." data-edited="false"></textarea>
</form>

POST #

<form action="#" method="post" class="comment-form reply-form">
  <textarea class="comment-input reply-input" name="reply" data-defaulttext="Reply to this comment here." data-edited="false"></textarea>
</form>

POST #

<form action="#" method="post" class="comment-form reply-form">
  <textarea class="comment-input reply-input" name="reply" data-defaulttext="Reply to this comment here." data-edited="false"></textarea>
</form>

POST #

<form action="#" method="post" class="comment-form reply-form">
  <textarea class="comment-input reply-input" name="reply" data-defaulttext="Reply to this comment here." data-edited="false"></textarea>
</form>

POST #

<form action="#" method="post" class="comment-form reply-form">
  <textarea class="comment-input reply-input" name="reply" data-defaulttext="Reply to this comment here." data-edited="false"></textarea>
</form>

POST #

<form action="#" method="post" class="comment-form reply-form">
  <textarea class="comment-input reply-input" name="reply" data-defaulttext="Reply to this comment here." data-edited="false"></textarea>
</form>

Text Content

The ServiceNow Development Handbook 3rd Edition is out now! Click here to get
your copy, and level-up your ServiceNow development career!

 * Pro-Tips Blog
 * Blog Archive
 * Subscribe
 * Books
    * Learning ServiceNow
    * SN Developer Handbook
    * Building Powerful Workflows

 * Tools
    * A Better, One-Click Approval
    * Advanced Attachment Copy Util
    * Custom Chrome Engines
    * Detect Duplicates (Single or Multi-field)
    * EfficientGlideRecord (Client-side)
    * Enable Guided Setup Creation
    * Get Latest Docs Page Version
    * Get RITM Variables via SRAPI
    * Include in Update Set Tool
    * Journal Redactor
    * Login Link Generator
    * Paginated GlideRecord Utility
    * reCAPTCHA Integration
    * Service Portal: Attachments & DOM
    * Set Catalog Item Variables from URL
    * Smarter Update Sets
    * SN Framerizer Extension
    * SN JS Libraries
    * Temporary Permissions Utility
    * Time-Zone Utilities
    * Try Catalog Item in Portal
    * Update Relocator
    * Update Set Collision Avoidance
    * URL Shortener (go.snc.guru)
    * Was this Email Helpful?

 * Useful Scripts
 * Contact
    * Contact Us
    * Community Discord
    * Community Slack
    * Community Telegram

 * Search

Menu

The SN Guys
Vancouver, WA, 98686
(971) 410-8777
Grow with purpose! ServiceNow Pro-tips, tricks, consulting, and undocumented
information on the ServiceNow platform

Your Custom Text Here




 * Pro-Tips Blog
 * Blog Archive
 * Subscribe
 * Books
    * Learning ServiceNow
    * SN Developer Handbook
    * Building Powerful Workflows

 * Tools
    * A Better, One-Click Approval
    * Advanced Attachment Copy Util
    * Custom Chrome Engines
    * Detect Duplicates (Single or Multi-field)
    * EfficientGlideRecord (Client-side)
    * Enable Guided Setup Creation
    * Get Latest Docs Page Version
    * Get RITM Variables via SRAPI
    * Include in Update Set Tool
    * Journal Redactor
    * Login Link Generator
    * Paginated GlideRecord Utility
    * reCAPTCHA Integration
    * Service Portal: Attachments & DOM
    * Set Catalog Item Variables from URL
    * Smarter Update Sets
    * SN Framerizer Extension
    * SN JS Libraries
    * Temporary Permissions Utility
    * Time-Zone Utilities
    * Try Catalog Item in Portal
    * Update Relocator
    * Update Set Collision Avoidance
    * URL Shortener (go.snc.guru)
    * Was this Email Helpful?

 * Useful Scripts
 * Contact
    * Contact Us
    * Community Discord
    * Community Slack
    * Community Telegram

 * Search





JOURNALREDACTOR - EASILY REDACT OR DELETE JOURNAL ENTRIES IN SERVICENOW!

September 7, 2018 Tim Woodruff

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: 

 1. Journal Entry [sys_journal_field]
 2. Audit [sys_audit]
 3. History Set [sys_history_set]
 4. 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'; //sys_id of the record on which the journal entry resides
var oldJournalText = 'customer social is 123-45-6789'; //The EXACT, COMPLETE text of the journal entry to be redacted.

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!

--------------------------------------------------------------------------------


SUBSCRIBE

Sign up with your email address to receive news and updates.

Email Address
Sign Up


We respect your privacy.

Thank you!


--------------------------------------------------------------------------------

 * March 2024
   * Mar 28, 2024 How to Identify Duplicate Records by Multiple Fields in
     ServiceNow Mar 28, 2024
   * Mar 7, 2024 How to Merge Personal & Company ServiceNow Accounts Mar 7, 2024
 * February 2024
   * Feb 12, 2024 5 Lessons About Programming From Richard Feynman Feb 12, 2024
 * July 2023
   * Jul 5, 2023 Managing Instance-Specific System Properties for Dev/Test/Prod
     in ServiceNow Jul 5, 2023
 * May 2023
   * May 11, 2023 5 Ways to Check your ServiceNow Instance for DANGEROUS CODE in
     Less Than 5 minutes May 11, 2023
 * April 2023
   * Apr 28, 2023 Your ACLs and Business Rules are Broken (Here's How to Fix
     Them) Apr 28, 2023
 * December 2022
   * Dec 13, 2022 ServiceNow Developers: BE THE GUIDE! Dec 13, 2022
 * October 2022
   * Oct 19, 2022 A Faster, More Efficient Client-side GlideRecord (Free tool!)
     Oct 19, 2022
   * Oct 9, 2022 Animated Loading Message & Collapsible Details on ServiceNow
     Form or Field (Client-side) Oct 9, 2022
 * August 2022
   * Aug 23, 2022 Using .addJoinQuery() & How to Query Records with Attachments
     in ServiceNow Aug 23, 2022
   * Aug 18, 2022 Free, Simple URL Shortener for ServiceNow Nerds (snc.guru) Aug
     18, 2022
   * Aug 16, 2022 How to Get and Parse ServiceNow Journal Entries as
     Strings/HTML Aug 16, 2022
   * Aug 14, 2022 New tool: Get Latest Version of ServiceNow Docs Page Aug 14,
     2022
 * March 2022
   * Mar 4, 2022 How to Set or Change ServiceNow Application's Repository URL,
     Credentials, or SSH Key Mar 4, 2022
 * February 2022
   * Feb 7, 2022 How to return a CSV file from a Scripted REST API (SRAPI) in
     ServiceNow Feb 7, 2022
 * May 2021
   * May 3, 2021 Adding a Guided Setup to Your ServiceNow Application May 3,
     2021
 * April 2021
   * Apr 27, 2021 Use Automated Tests to Validate "Guided Setup" Completion &
     Functionality. Apr 27, 2021
 * February 2021
   * Feb 11, 2021 "Processors", SRAPIs, and How to Run a Script and Redirect a
     User From a URL in ServiceNow Feb 11, 2021
 * November 2020
   * Nov 17, 2020 SN Guys is now part of Jahnel Group! Nov 17, 2020
 * September 2020
   * Sep 14, 2020 Better ServiceNow Notifications (& Another FREE Tool!) Sep 14,
     2020
 * July 2020
   * Jul 31, 2020 Debugging Client & Catalog Client Scripts in ServiceNow Jul
     31, 2020
 * January 2020
   * Jan 20, 2020 Getting Help from the ServiceNow Community Jan 20, 2020
 * December 2019
   * Dec 18, 2019 Can ServiceNow Script Includes Use the "current" Variable? Dec
     18, 2019
 * November 2019
   * Nov 18, 2019 Handling 'text/plain' and Other Unsupported Content Types in
     ServiceNow Scripted REST APIs Nov 18, 2019
 * April 2019
   * Apr 21, 2019 Understanding Attachments in ServiceNow Apr 21, 2019
   * Apr 10, 2019 Using Custom Search Engines in Chrome to Quickly Navigate
     ServiceNow Apr 10, 2019
   * Apr 4, 2019 Set Catalog Variables from URL Params (Free tool) Apr 4, 2019
   * Apr 1, 2019 Outlook for Android Breaks Email Approvals (+Solution) Apr 1,
     2019
 * March 2019
   * Mar 11, 2019 GlideFilter is Broken - Free Tool: “BetterGlideFilter” Mar 11,
     2019
 * February 2019
   * Feb 27, 2019 Making Update Sets Smarter - Free Tool Feb 27, 2019
 * November 2018
   * Nov 29, 2018 How to Learn ServiceNow Nov 29, 2018
   * Nov 6, 2018 ServiceNow & ITSM as a Career? Nov 6, 2018
 * October 2018
   * Oct 19, 2018 Asynchronous onSubmit Catalog/Client Scripts in ServiceNow Oct
     19, 2018
   * Oct 11, 2018 How to do Massive, Slow Database Operations Efficiently With
     Event-Driven Recursion Oct 11, 2018
 * September 2018
   * Sep 18, 2018 Broken Queries & Query Business Rules in ServiceNow Sep 18,
     2018
   * Sep 7, 2018 JournalRedactor - Easily Redact or Delete Journal Entries in
     ServiceNow! Sep 7, 2018
 * July 2018
   * Jul 23, 2018 Admin Duty Separation with a Single Account Jul 23, 2018
 * June 2018
   * Jun 19, 2018 Improving Performance on Older Instances with Table Rotation
     Jun 19, 2018
   * Jun 4, 2018 New Free Tool: Login Link Generator Jun 4, 2018
 * May 2018
   * May 29, 2018 Learning ServiceNow: Second Edition! May 29, 2018
 * April 2018
   * Apr 17, 2018 Upgrading From Express to Enterprise: What's Missing Apr 17,
     2018
   * Apr 12, 2018 If a Genie Gave Me Three Wishes, I'd Use Them All to "Fix"
     Scope Apr 12, 2018
 * March 2018
   * Mar 19, 2018 Service Catalog "Try in Portal" button Mar 19, 2018
   * Mar 15, 2018 Video: Custom Output Transition Conditions From a Single
     Workflow (Script) Activity Mar 15, 2018
 * February 2018
   * Feb 11, 2018 We have a new book! Feb 11, 2018
 * November 2017
   * Nov 6, 2017 Requiring Attachments (& Other Miracles) in Service Portal Nov
     6, 2017
 * September 2017
   * Sep 12, 2017 Handling TimeZones in ServiceNow (TimeZoneUtil) Sep 12, 2017
 * July 2017
   * Jul 27, 2017 How to Enable DOM Manipulation in ServiceNow Service Portal
     Catalog Client Scripts Jul 27, 2017
 * June 2017
   * Jun 25, 2017 What's New in ServiceNow: Jakarta (Pt. 1) Jun 25, 2017
   * Jun 4, 2017 Powerful Scripted Text Search in ServiceNow Jun 4, 2017
 * May 2017
   * May 9, 2017 Work at Lightspeed: ServiceNow's Plan for World Domination May
     9, 2017
 * April 2017
   * Apr 9, 2017 Avoiding Pass-By-Reference Using getValue() & setValue() Apr 9,
     2017
   * Apr 4, 2017 "Learning ServiceNow" is Now Available for Purchase! Apr 4,
     2017
 * March 2017
   * Mar 12, 2017 reCAPTCHA in ServiceNow CMS/Service Portal Mar 12, 2017
 * December 2016
   * Dec 20, 2016 Pro Tip: Use updateMultiple() for Maximum Efficiency! Dec 20,
     2016
   * Dec 2, 2016 We're Writing a Book! Dec 2, 2016
 * November 2016
   * Nov 10, 2016 Chrome Extension: Load in ServiceNow Frame Nov 10, 2016
 * September 2016
   * Sep 7, 2016 Force-Include Any Record Into an Update Set Sep 7, 2016
   * Sep 1, 2016 GlideRecord Pagination - Page through your GlideRecord query
     Sep 1, 2016
 * July 2016
   * Jul 17, 2016 Granting Temporary Roles/Groups in ServiceNow Jul 17, 2016
   * Jul 15, 2016 Scripted REST APIs & Retrieving RITM Variables via SRAPI Jul
     15, 2016
 * May 2016
   * May 17, 2016 What's New in Helsinki? May 17, 2016
 * April 2016
   * Apr 27, 2016 Customizing UI16 Through CSS and System Properties Apr 27,
     2016
   * Apr 5, 2016 ServiceNow Versions: Express Vs. Enterprise Apr 5, 2016
 * March 2016
   * Mar 28, 2016 Update Set Collision Avoidance Tool: V2 Mar 28, 2016
   * Mar 18, 2016 ServiceNow: What's New in Geneva & UI16 (Pt. 2) Mar 18, 2016
 * February 2016
   * Feb 22, 2016 Reference Field Auto-Complete Attributes Feb 22, 2016
   * Feb 6, 2016 GlideRecord & GlideAjax: Client-Side Vs. Server-Side Feb 6,
     2016
   * Feb 1, 2016 Make Your Log Entries Easier to Find Feb 1, 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
 * 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
 * October 2015
   * Oct 20, 2015 Bookmarklet: Load the current page in the ServiceNow frame Oct
     20, 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.

--------------------------------------------------------------------------------

Share

2 Likes
← Broken Queries & Query Business Rules in ServiceNowAdmin Duty Separation with
a Single Account →


COMMENTS (5)

Newest First Oldest First Newest First Most Liked Least Liked
Preview Post Comment…

Kim 3 years ago Pending Awaiting Moderation · 1 Like


Hey Tim -- yes there is more, just wasn't sure if you needed it. Here it is:
redact method of JournalRedactor Script Include: Not ready for redaction. Some
data is missing from journalEntryData:
{"journal_entry_id":"b418376b1be32050ad94fd13cd4bcba1","target_record_id":"d418e9ea8723681020430d47cebb3531","target_table_name":"incident","old_journal_value":"test
to delete this entry","journal_field_name":"work_notes","new_journal_value":""}:
no thrown error

The script I'm using is a Scheduled Job for testing:
var redactor = new JournalRedactor();
redactor.setJournalID('b418376b1be32050ad94fd13cd4bcba1');
redactor.redact(true);

*Also, I gave the admin role delete rights to all 4 of the tables involved.

Preview Post Reply

Tim Woodruff 3 years ago Pending Awaiting Moderation · 1 Like


Looks like it's failing to detect the new journal entry data, which shouldn't
actually be necessary.
Please go into your JournalRedactor Script Include, find line 181, and replace
it with this:

if (p != 'old_journal_value' && p != 'new_journal_value' &&
!journalEntryData[p]) {

I'll update the gist to reflect this change.

Preview Post Reply

Tim Woodruff 3 years ago Pending Awaiting Moderation · 1 Like


@Kim - You can now download the updated SI XML from http://redactor.snc.guru/
and import it into your Script Include table if you prefer. It will overwrite
the existing file.
Please report back and let me know if this resolves the issue for you.

Preview Post Reply

Kim 3 years ago Pending Awaiting Moderation · 1 Like


Hey Tim -- this is awesome. I'm testing it now in my DEV space. I keep getting
this error: journalEntryData not ready for redaction. Any tips?

Preview Post Reply

Tim Woodruff 3 years ago Pending Awaiting Moderation · 1 Like


Hey Kim,

I can't likely do much to help without seeing any of your code, but that error
occurs when you haven't specified a journal entry to redact, or when such a
journal entry was not found. The line of code responsible for that error can be
found on line 183 in this gist (based on the version available at the time of
writing). So I'm assuming you may not be instantiating it with the journal ID,
or that you may have missed some of the usage instructions on the tools page.

Preview Post Reply




©SN Pro Tips, 2023

Mastodon