This article provides a step-by-step guide to configuring the JSON Table macro in Confluence to augment data row values.
...
Navigate to the app Global configuration page and configure the profile.
Insert and configure the JSON table macro, as illustrated below.
a. Select the configured Profile.b. Configure the Path to fields and Augment field section as given below:
Code Block Paths to fields: $ Paths to fields to be included: $.key, $.name, $.lead.active, $.projectTypeKey Augments to data row values: ,,,!Advanced Tables - JSON table macro augmentation^%lead.active%.png!, Augments to heading row values: ,,Status,Image Columns to display: key,name,lead.active,Image,projectTypeKey
The Augments to data row values have a new column parameter!Advanced Tables - JSON table macro augmentation^%lead.active%.png!
. This is a replacement parameter that will replace the value oflead.active
from true/false to image formats. This value will not alter the original column: $lead.active, but adds a new column where thelead.active
values are represented as images instead of text.
To render the data in image formats, attach two images with the exact naming convention of thelead.active
values. For example, on the page Advanced Tables—JSON table macro augmentation, attach true.png and false.png files. Images attached for reference:To display the active projects at the top, apply the settings as shown below:
Here is the Storage format for quick reference:Code Block <p><br /></p> <p>Get the Jira Project details from <a href="<BASE_URL>/rest/api/2/project?expand=lead"><BASE_URL>/rest/api/2/project?expand=lead</a> and display them in JSON table macro. </p> <p>Use the augmentation to replace the text on a certain column. For example, the lead.active returns true/false( representing the project status: Active / Inactive). To help users understand, one can replace/duplicate the original column to show the desired text in the image format as shown below.</p> <p><br /></p><ac:structured-macro ac:name="json-table" ac:schema-version="1" ac:macro-id="85e18df5-d88b-41d8-a077-c767ac960693"><ac:parameter ac:name="output">wiki</ac:parameter><ac:parameter ac:name="sortDescending">true</ac:parameter><ac:parameter ac:name="fieldPaths">$.key, $.name, $.lead.active, $.projectTypeKey</ac:parameter><ac:parameter ac:name="sortColumn">Status</ac:parameter><ac:parameter ac:name="columns">key,name,lead.active,Image,projectTypeKey</ac:parameter><ac:parameter ac:name="paths">$</ac:parameter><ac:parameter ac:name="profile">Jira Max</ac:parameter><ac:parameter ac:name="headingAugments">,,Status,Image</ac:parameter><ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter><ac:parameter ac:name="augments">,,,!Advanced Tables - JSON table macro augmentation^%lead.active%.png!,</ac:parameter></ac:structured-macro> <p><br /></p> <p><br /></p> <div class="table-wrap"><br /></div><ac:structured-macro ac:name="json-table" ac:schema-version="1" ac:macro-id="6783c445-589e-43ad-b57f-a01560c6f51b"><ac:parameter ac:name="output">wiki</ac:parameter><ac:parameter ac:name="sortDescending">true</ac:parameter><ac:parameter ac:name="fieldPaths">$.key, $.name, $.lead.active, $.projectTypeKey</ac:parameter><ac:parameter ac:name="sortColumn">Status</ac:parameter><ac:parameter ac:name="columns">key,name,lead.active,Image,projectTypeKey</ac:parameter><ac:parameter ac:name="paths">$</ac:parameter><ac:parameter ac:name="profile">Jira Max</ac:parameter><ac:parameter ac:name="headingAugments">,,Status,Image</ac:parameter><ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter><ac:parameter ac:name="augments">,,,!Advanced Tables - JSON table macro augmentation^%lead.active%.png!,</ac:parameter></ac:structured-macro> <div class="table-wrap"><br /></div> <p><br /></p>
Save the macro and update the page to view the result. As you see, the project status (active/inactive) is now displayed as image icons.