Reporting Confluence Data Provider macro allows reading of Confluence item data from current Confluence. The items are searched by specified CQL query. The max number of items may be specified, but cannot be higher than 1000 items. Data providers in Reporting return data in a form of an array of JSON objects - one JSON object per each report line. Then, in Reporting Table Item formulas these objects may be accessed via CurrentItem variable.

Reporting table of Confluence pages with creator, last editor, last edited date and days since the edit

Example: Confluence pages returned by a CQL query, with creator, last editor and days since the last edit.

Reporting Confluence Data Provider macro has the following parameters:

Parameter Description
[String] Query (default=''(Empty value))

A CQL query to be used to search for Confluence items. This parameter cannot be empty.

Examples:

  • 'Space = TST' - returns all Confluence items (pages, attachments, comments) of the TST space.

New! The query may contain variables that are replaced with the current page's values before the query runs, so the same report placed in a page template works on every page created from it:

  • '${page.title}' - the title of the page
  • '${page.id}' - the page ID
  • '${space.key}' - the key of the page's space
  • '${today}' - today's date as YYYY-MM-DD

Put them inside quotes, e.g. 'label = "${page.title}" and space = "${space.key}"' - quotes inside the values are escaped automatically.

[String] Expand (default=''(Empty value))

A multi-value parameter indicating which properties of the content to expand. A good set of examples is specified here.

Examples:

  • 'history' - Returns the history of the content, including the date it was created.

Known limitation On Confluence Server/Data Center, the creation and last-update dates exposed via 'history' (CurrentItem.content.history.createdDate, CurrentItem.content.history.lastUpdated.when) currently come back empty, even though the corresponding people fields (createdBy, lastUpdated.by) resolve correctly and Confluence's own REST API returns a real value for the same page. We believe this is a gap in how Confluence's underlying search service populates these two fields rather than something a workaround on our side can currently fix. There is currently no workaround for pulling these two specific date fields through this macro; we are tracking the issue and will update this note once it's resolved.

[String] Filter (default=''(Empty value))

The formula, which filters out the values when it returns False. Ignored if empty. A comparison that cannot be evaluated – a number against text, or an empty field – counts as False (since Reporting 14.1.0).

Examples:

  • 'FIND("Report", CurrentItem.content.title) > 0' - Returns True for the pages with the title, which contains a 'Report' word. So this formula helps to create a report with the pages, which have 'Report' word in its name.
  • 'CurrentItem.points > Average(AllItems.points)' – New! – keeps only the rows whose 'points' value is above the average 'points' value across all the (unfiltered) fetched items. In addition to CurrentItem, the Filter formula may now reference AllItems / AllItems.<path> – a range covering every fetched row's value at that path – so aggregate functions like Sum, Average, Max, Min can be used to build "above the average" / "equal to the max" style filters.
[Long] Max results (default=1000) The maximum amount of items to be returned. This feature is convenient to create the lists of TOP Something, when the items are sorted in CQL query and the amount is limited with this parameter.

More examples

Child pages of the current page with the number of their own child pages and the last editor

Example: Query parent = ${page.id} with Expand children.page lists the child pages of the current page and counts their own children with JSONARRAYLENGTH(CurrentItem.children.page.results).