Ability to add input rationale Comment under History section in Info tab?

Hi All, We have requirement to add ** input rationale comment** when we will save or publish and content node, that part is completed.

Now wanted to show our comment in existing History section under Info tab.

Currently we have: UserName | Action | Type

New Requirenment: Currently we have: UserName | Action | Type | Rational Comment

Will it be safe to modify existing Umbraco functionality? If it’s fine to do then kindly suggest correct approch?

Version: 17.4.2

Hi @Ajeetkmr154

I wouldn’t modify the core backoffice files, they get replaced on every upgrade.

A lot depends on where you’re storing the comment at the moment. There’s actually a way you can write directly into the audit log with a custom message:

await _auditService.AddAsync(
    AuditType.Custom,
    userKey,          // Guid of the current backoffice user
    content.Id,
    UmbracoObjectTypes.Document.GetName(),
    null,
    "Your rationale here");

The message has to go in the last (parameters) argument, the comment one isn’t shown. It appears as its own “Custom” row in History rather than an extra column. See: Allow non-core code to write to the "History" (Audit log) · umbraco/Umbraco-CMS · Discussion #16771 · GitHub

If you want an actual extra column, the boxes on the Info tab are workspaceInfoApp extensions and History is Umb.WorkspaceInfoApp.Document.History, so you can add your own alongside it or overwrite it. If your comments are in your own table, you’ll need a Management API controller to expose them to the backoffice.

Where are you storing the comment currently?

Justin