Firstly, let's take a look at the macro parameter settings
Macro parameter setting can realize dynamic replacement of macro parameters in templates. For example, the template contains a jira macro whose Jql parameter value is "project = TW and created <= 2022-06-01". If the report is generated periodically from this template, this part of the report will be fixed, showing the project " TW" Jira data at the "2022-06-01" time node. Through the macro parameter replacement setting, when each report is generated, "TW" can be replaced with the project corresponding to this report, and "2022-06-01" can be replaced with the report generation date, the start date of the period, and the end date of the period. The operation steps are as follows: Click “Macro Param” to pop up the configuration window of Macro Param Replacement. Click “New Param Replacement” to set a replacement rule for macro parameters: Param Content: The macro parameter to be dynamically replaced. Replace To: The replaced target macro parameter, including Report Creation Date, Start Date(Period), End Date(Period), Reporter’s Name, Reporter’s Full Name, Project Name, Project Key. Date Offset: The date offset is only showed when replacing to the three types of "Report Generation Date", "Start Date(Period)", and "End Date(Period)". The number of days can be increased or decreased based on the date of the corresponding dynamic parameter, and the upper and lower limit is 365 days. Click "Save" to add successfully.Macro parameter setting
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!