4.3 Confluence Macro with Variable Parameter

Firstly, let's take a look at the macro parameter settings

Based on the macro parameter setting, let's briefly introduce and demonstrate which Confluence macros support dynamic transformation of macro parameters.

Jira Issue/Filter Macro

In the template using the "Jira Issue/Filter" macro (either a blueprint template or a user template), we enter the JQL parameter as "project = DRFC and assignee = admin and issuetype in (Bug) and created >= 1970-01-01".

If we replace "admin" with the “Reporter's Name” and "1970-01-01" with “Start Date(Period)” as shown below.

Then the original JQL will be automatically replaced with "project = DRFC and assignee = momo and issuetype in (Bug) and created >= 2022-08-07" in the automatically generated report, as shown in the figure.

Date Macro

In the template using the "Date" macro (either a blueprint template or a user template), we set two dates "1970-01-01", "1970-01-02".

If we replace "1970-01-01" with “Start Date(Period)” and "1970-01-02" with “End Date(Period)” as shown below.

Then these two dates will be automatically replaced with the start date and end date of the period in the automatically generated report, as shown in the figure

Excerpt Include Macro

In the template using the "Excerpt Include" macro (either a blueprint template or a user template), we set the page parameter of the excerpt as "excerpt content 1970-01-01".

If we replace "1970-01-01" with “Report Creation Date” as shown below.

Then, the page parameters quoted by the excerpt will be automatically replaced with excerpt content of page "2022-08-17" in the automatically generated report, as shown in the figure.

Note: This operation is performed under the premise that there is the page "2022-08-17" containing Excerpt.

As macro parameter replacement can be used in many situations, you can go and find more flexible collocations and usages!