Publish Post Case Review (PCR) to Work Notes Instead of Additional Comments

Praveenapatel
Tera Contributor

Overview

Out of the box (OOB), when a Post Case Review (PCR) is published using the Publish to Case button, the final PCR content and its attachment are added to the Additional Comments field of the related Case.

 

Requirement

For internal users, the PCR content and its attachment must be added to Work Notes instead of Additional Comments - not only for the parent case, but also for all related child cases.

 

Purpose of This Article

This article explains:

  • Which OOB Script Includes are involved in the PCR publish flow

  • How to extend and override the logic using editable Script Includes

Note: Most of the OOB Script Includes involved in this process are read-only, so the solution requires extending or overriding the logic rather than modifying OOB code directly.

 

OOB Configuration (Default Behavior)

When a user clicks Publish to Case on the PCR record:

  1. A UI Action is triggered.

  2. The UI Action calls a chain of Script Includes.

  3. The PCR content and attachment are written to Additional Comments on:

    • The parent case

    • Any child cases (if applicable)


Step 1: Identify the UI Action

Navigate to: System UI → UI Actions

Open the UI Action: Publish to Case

 

Screenshot 2025-12-22 at 2.53.43 AM.png


Step 2: Identify the Initial Script Include

The Publish to Case UI Action calls the Script Include: CaseDigestUtilAjaxSNC (Read-only)

Open the CaseDigestUtilAjaxSNC Script Include and locate the method: publishtoCase

 

Screenshot 2025-12-22 at 2.55.00 AM.png


Step 3: Trace the Script Include Flow

The "publish to Case " method calls another Script Include: CaseDigest (Editable)

The CaseDigest Script Include extends the following Script Includes:

  • CaseDigestImpl (Read-only): Calls the "addAdditionalCommenttoCase" method

  • CaseDigestDao (Read-only): Contains the "addAdditionalCommenttoCase" method

These Script Includes together handle the logic for publishing the PCR content to the Case.

Praveenapatel_1-1766352439414.png


Step 4: Review CaseDigestDao (OOB Logic)

The CaseDigestDao Script Include contains the actual database update logic responsible for adding PCR content to the Case (in the method "addAdditionalCommenttoCase").

In the OOB implementation, the logic explicitly updates the Additional Comments field on the Case record.

Note: Since this Script Include is read-only, it cannot be modified directly. Need to create another SI.

 

Screenshot 2025-12-22 at 2.57.49 AM.png


Step 5: Override Logic in Editable Script Include

Because CaseDigestImpl and CaseDigestDao are read-only, the behavior must be overridden in the CaseDigest Script Include.

 

Step 5.1: Update CaseDigest Script Include

In the CaseDigest Script Include:

  • Redefine the "addAdditionalCommenttoCase" logic

  • Update the implementation to:

    • Write the PCR content to Work Notes instead of Additional Comments

    • Ensure the PCR attachment is added to the Case record

This change ensures that the parent case receives the PCR content and attachment in Work Notes.

 

Screenshot 2025-12-22 at 2.58.25 AM.png


Step 6: Handle Child Cases (Major Case Scenario)

When a Case has child cases:

  • OOB behavior prompts the user to confirm whether the PCR should be published to the child cases

  • If the user confirms, the PCR content is added to the Additional Comments field of each child case

To change this behavior, additional Script Includes must be reviewed and overridden.


Step 7: Identify Child Case Publish Logic

The child case publishing logic is handled by the following Script Includes:

  • MajorCaseDigest (Read-only)

  • MajorCaseDigestImpl (Read-only)

Inside MajorCaseDigestImpl, locate the method: bulkPublish()

This method is responsible for publishing the PCR content to child cases and, in the OOB configuration, writes the content to Additional Comments.

 

Screenshot 2025-12-22 at 2.59.06 AM.png


Step 8: Create Custom Script Include for Child Cases

Because MajorCaseDigestImpl is read-only:

  1. Create a new custom Script Include (for example: Custom_MajorCaseDigest)

  2. Replicate the OOB "bulkPublish()" logic

  3. Modify the logic to:

    • Write PCR content to Work Notes

    • Copy the PCR attachment to each child case

Screenshot 2025-12-22 at 3.00.11 AM.png


Step 9: Update Script Action Trigger

The Script Action triggers the child case publishing process: Major Case Propagate

Update this Script Action to:

  • Call the custom Script Include

  • Invoke the modified bulkPublish() method

Screenshot 2025-12-22 at 3.00.38 AM.png


Final Outcome

After completing the above steps:

  • The PCR content and attachment are added to Work Notes for the parent case

  • The same behavior is applied to all child cases

  • No OOB read-only Script Includes are modified

Praveenapatel_3-1766352767366.png

 

0 REPLIES 0