Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Instructions

  1. Select Module in the top left banner then select the appropriate module name link.
  2. Select the appropriate module for which the comments in the grid are required.
  3. Scroll down in the Module Properties enabling the [Image ModifiedShow Rolledup Comments in the grid], then select Save.
  4. Select the Forms tab, followed by the Master SchemaField List button "Create/Update Fields".
  5. Search for "RolledupComments" in the field search above the field listing, select the field for editing.
  6. Enable [Show in grid] and [Image ModifiedHide in form].
  7. In the Column Header property type "Most Recent Comment".
  8. Select the Grid tab, pasting the formatting below into the Column Template section.

    Info

    <div class="ui-grid-cell-contents">

        {{grid.appScope.executeCustomJs(grid, row, col);}}

    </div>


  9. In the Custom JavaScript section paste the code below.

    Info

    var cellValue = grid.getCellValue(row, col);

    if (cellValue) {
        var retValue = '';
        var myToDRegEx = /([0-9]+:[0-9]+:[0-9]+ [A|P]M)(.*)/gm;
        var timeOfDay = myToDRegEx.exec(cellValue);
        var commentRegEx = /<\/span><br\/>(?!<span>)(?:.)*?<br\/>/m;
        var commentStr = commentRegEx.exec(cellValue);


        if (commentStr && commentStr.length > 0) {
            // remove up to the first close span
            var trimmedFirstSpan = commentStr[0].substring(12);
            var comment = "";

           // find first open span
           var afterSpan = trimmedFirstSpan.indexOf("<br/>");

            if (afterSpan >= 0) {
               comment = trimmedFirstSpan.substring(0, afterSpan);
               comment = comment.replace(/<(?:.)*?>/gm, '');
           }
            if (timeOfDay && timeOfDay.length > 0 && comment) {
                retValue = timeOfDay[1] + " -- " + comment;
                return retValue;
            }
        }
    }
    return undefined;



  10. Save the Master Schema Field List and return to the form list through the Breadcrumb in the top left or by selecting Module in the top left banner.
  11. Select the Default form, add the RolledupComments field to the form, then Save the Default form.
  12. Return to the main grid view verifying the most recent comment is appearing in the column labeled "Most Recent Comment" in the grid.


Filter by label (Content by label)
showLabelsfalse
max5
spacescom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@8fc
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel = "kb-how-to-article" and type = "page" and space = "HD"
labelskb-how-to-article

...