Dashboard > Atlassian Plugins > ... > Macros > repeat-filter
  Atlassian Plugins Log In | Sign Up   View a printable version of the current page.  
  repeat-filter

Added by David Peterson , last edited by David Peterson on Apr 03, 2008  (view change)
Labels: 

{repeat-filter}

Plugin: Reporting Plugin, from version 2.1.0

This filter checks if the current value is different from the previous one in the report.

Description

This filter is useful if you are working with data which is sorted according to a particular value and you only want to display the first occurrence of that value, rather than outputting the same text for each repeated occurrence.

Usage

{repeat-filter:prefix:key|match=[first/repeats]}

Parameters

Name Required Default Description
[default]/key
The key chain value to filter on.
match
first
Specify whether to match the first item only (the default behaviour) or repeats only. May be:
  • first - the first occurence only is displayed.
  • repeats - the repeated occurrences are displayed, not the first occurrence.

Examples

Display labeled pages grouped by parent.

This will display all pages with the 'todo' label, ordered by their parent page title, then their own title, with the heading only displayed once per parent.

{report-block}
{content-reporter:space=@self|type=page|labels=+todo}
  {text-sort:content:parent > content:title}
  {text-sort:content:title}
{content-reporter}

{repeat-filter:content:parent}
{report-body}
h3. {report-info:content:parent|link=true|default=_No parent_}
{report-body}

{report-body}
*{report-info:content:title|link=true}* - {report-info:content:excerpt|render=wiki}
{report-body}

{report-block}

Notes

This macro will only check the previous result, it will not check that a value has occurred somewhere in any of the previous results for the report. For example, if you are reporting on a list which contains "A, B, B, A", only the first "B" will match, but both "A"s will, since they are not sequential.

Recipes

Copyright(c) CustomWare Asia Pacific Pty Ltd
Powered by Atlassian Confluence 2.7.3, the Enterprise Wiki. Bug/feature request - Atlassian news - Contact administrators