Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Scaffolding Cloud: Converted Scaffolding Server macros to Scaffolding Cloud macros.
Live template
templateTypetemplate
templateOption{"label":"Macro Reference Live Template v2","value":"979936587","templateType":"template"}
templateTypeOption{"label":"Confluence template/blueprint","value":"template"}
templateId979936587
excerptDescription Defines a temporary variable that can hold data in the current report context. If used outside a report the value will only last for the current page request. Variables can be overwritten further down the page content, but are each unique to a particular report context. Use in conjunction with the Variable Supplier  to retrieve variables for use. Parameters Name Required Migratable to Cloud? Default Value Description Name (/) No The name for the variable. Any existing variable in the same context with the same name will be replaced. Value (x) No Either value or a reporter in the macro body  must  be specified. This can be a text value or an %injected% value. If the latter, and the  whole  value is a single %injection% , the actual value will be stored. If it is a mix of text and injections it will be a text value. Default Value (x) No Either a text value or an %injected% value. This will be used if the value/reporter is empty. Editor View Macro Edit View Not applicable. Notes The body can also be used to store a "reporter", such as   Local Reporter   or   Content Reporter . The report results will be cached and can be reused multiple times on the same page. For example, the following will store the list of pages with the "foo" label in descending order as "foo": {report-variable:foo} {content-reporter:type=page|label=foo} {text-sort:page:title|order=descending} {content-reporter}{report-variable} It can then be executed in a report by using   Local Reporter : {report-list} {local-reporter:variable:foo} {report-body}{report-info:page:title|link=true}{report-body} {report-list} The same "variable:foo" could be used in other reports on the page, and even have additional "sort" or "filter" macros applied. It can also be used directly in a   Report On   or   Report Info   macro and the results iterated over. Quick Examples Setting variables to specific values In conjunction with the   Value Supplier , you can set a variable to a specific text, number or even Confluence content value: {report-variable:a number|value=%value:number 12345%} {report-variable:a date|value=%value:date(dd-MMM-yyyy) 25-Nov-2009%} {report-variable:a page|value=%value:content SPACE:My Page%} Looping variables You can set variables up to increment through a report loop. {report-block} {local-reporter:page:children} {report-body} {report-variable:increment|value=%variable:increment > + 1%|default=%value:number 0%} h4. {report-info:page:title} *Increment:* {report-info:variable:increment} {report-body} {report-block} Store a selected random value in report output You can use report variable to store a selected random value in the report output. In this example, for each page label on the current page, we are storing a random content with the same label and extracting additional data from that randomly selected page. {report-list} {local-reporter:key=page:labels} {report-body} {report-variable:name=random|value=%report:item > label:content > collection:random%}Label {report-info:key=label:name|link=true}: Random content with label: {report-info:key=variable:random > page:title|link=true}. Created by: {report-info:key=variable:random > page:creator|link=true} on {report-info:key=variable:random > page:creation date|link=true} {report-body} {report-empty}This page has no labels.{report-empty} {report-list} Reusing Reporter configurations The   Query Supplier   was added in Reporting 3.3.0. Ensure you have upgraded to use this example. You can store a reporter   query   as a variable, either to use via   Report Info   or to execute in a separate report via   Local Reporter . {report-variable:Page Children} {local-reporter:page:children} {content-filter:@self|label=+foo} {local-reporter} {report-variable} Random Foo: {report-info:variable:Page Children > query:as collection > collection:random|link=true} All Foo Children: {report-list} {local-reporter:variable:Page Children} {text-sort:page:title} {local-reporter} {report-body}{report-info:page:title|link=true} (Created by {report-info:page:creator|link=true}){report-body} {report-list}
fieldGroupKeys{"gnidfuekr7":["net.customware.confluence.plugin.scaffolding__gnidfuekr7__data_0_th2rcro7b63ed71npzjc"]}

Tutorial Examples