Building an Advanced Table from Rest API Data
On this page
Overview
This page shows how to use the JSON Table macro, which is part of the Advanced Tables for Confluence add-on, to create a table that contains version information retrieved directly from JIRA. This example uses a number of the advanced capabilities of the JSON Table macro, including Augments to transform data into links and a particular emoticon, so the data is presented in a succinct, informative manner. The columns can be customized to meet your specific needs.
Macro Browser Input
Select this Macro
Macro Name | JSON Table |
Macro Syntax | {json-table} |
Define these Parameters/Values
Paths to array fields | $ |
Paths to fields to be included | name,description,releaseDate,released,archived,userReleaseDate,self |
Paths to be used to determine sort order | name |
Output format | wiki |
URL to JSON data | https://bobswift.atlassian.net/rest/api/2/project/TBL/versions |
Column to show | name,description,releaseDate,released,archived |
Augments to data row values | [%name%| https://appfire.atlassian.net/browse/TBL/fixforversion/%id% ],,,!%released%.png!,!%archived%.png! |
Augments to heading row values | Name,Description,Release Date, Released, Archived |
Sort descending | selected |
Auto number on each row | selected |
Screenshots
Wiki Markup Input
{json-table: paths=$| fieldPaths=name,description,releaseDate,released,archived,userReleaseDate,self| sortPaths=name| url=https://bobswift.atlassian.net/rest/api/2/project/TBL/versions| output=wiki| columns=name,description,releaseDate,released,archived| augments=[%name%%!%https://appfire.atlassian.net/browse/TBL/fixforversion/%id%],,,!%released%.png!,!%archived%.png!,| headingAugments=Name,Description,Release Date, Released, Archived| sortDescending=true| autoNumber=true} {json-table}
Emoticons
For this example, we augmented the true and false values of the released and archived fields to show an emoticon instead. This is a general technique that can be used to make tables look better. For this case, it is simply having emoticon images named true and false and attached to this page (or some other page) and referenced in wiki markup notation by !true.png! and !false.png!. On your site, you will need to add those 2 images and reference them accordingly. They can be named differently, but must have true and false in the name somewhere so the released and archived values will determine which emoticon is shown. Wiki markup notation for images in the most general way is: !SPACE:my page^myimg.jpg!.
Example Result
Other Examples
Visit our full list of product examples for additional inspiration!
Log a request with our support team.
Confluence®, Jira®, Atlassian Bamboo®, Bitbucket®, Fisheye®, and Atlassian Crucible® are registered trademarks of Atlassian®
Copyright © 2005 - 2024 Appfire | All rights reserved. Appfire™, the 'Apps for makers™' slogan and Bob Swift Atlassian Apps™ are all trademarks of Appfire Technologies, LLC.