How to use an injected variable in a reporting macro parameters ?

  • 1
  • Question
  • Updated 2 years ago
How to use an injected variable in a reporting macro parameters ?

For instance I try to define the Include parameter (Text Filter macro) as something like

.*%variable:myvariable%.*

without any success.

Another try is to define something like

content:body > body:text > text:find %variable:myvariable% > collection.size

into the Key parameter of the Report Info macro. How is it possible to do so ?

My primary need is to use a current/dynamic page data (e.g. page title) and use this data into several Reporting macros parameters.

I found some workarounds with Report On but was not able to apply them...

Thanks for any help !
Photo of Emmanuel Etasse

Emmanuel Etasse

  • 3 Posts
  • 0 Reply Likes

Posted 2 years ago

  • 1
Photo of Suresh Mathusuthanan

Suresh Mathusuthanan, Alum

  • 117 Posts
  • 9 Reply Likes
Hi Emmanuel,

Can you share with us the page's current storage format ?

You can get the storage format of the page via: 
  • Menu (at the top right corner of the page) > Storage Format

Thank you.

Regards,
Suresh
Photo of Emmanuel Etasse

Emmanuel Etasse

  • 3 Posts
  • 0 Reply Likes
Thanks Suresh,

Here the source of the page : the purpose of this code is to loop over some pages which content contains the current page title : this why I defined a variable (page:title) and I try to use it in the filter.
<br> <p><br> <ac:structured-macro ac:macro-id="88473144-c59e-4cb3-bb59-fc68bddf46cb" ac:name="report-variable" ac:schema-version="1"><br> <ac:parameter ac:name="name">currentpagetitle</ac:parameter><br> <ac:parameter ac:name="value">%page:title%</ac:parameter><br> <ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter><br> <ac:rich-text-body><br> <p> </p><br> </ac:rich-text-body><br> </ac:structured-macro> </p><br> <p><br> <ac:structured-macro ac:macro-id="a4e6a553-e9ba-4346-bf22-c73885ba5f62" ac:name="report-info" ac:schema-version="1"><br> <ac:parameter ac:name="">variable:currentpagetitle</ac:parameter><br> </ac:structured-macro><br> </p><br> <p> </p><br> <ac:structured-macro ac:macro-id="284bc48e-1176-4856-85ad-81a99b55a74d" ac:name="report-list" ac:schema-version="1"><br> <ac:parameter ac:name="maxResults">15</ac:parameter><br> <ac:parameter ac:name="style">disc</ac:parameter><br> <ac:rich-text-body><br> <ac:structured-macro ac:macro-id="069a2613-13e0-4c49-a7a3-6d8a9e96833b" ac:name="content-reporter" ac:schema-version="1"><br> <ac:parameter ac:name="types">page, comment, news</ac:parameter><br> <ac:parameter ac:name="scope">HHHH Liquidity > descendents</ac:parameter><br> <ac:parameter ac:name="labels">estproj</ac:parameter><br> <ac:rich-text-body><br> <p><br> <ac:structured-macro ac:macro-id="da32d01b-1e29-49c8-9218-6637be72f504" ac:name="date-sort" ac:schema-version="1"><br> <ac:parameter ac:name="">modification date</ac:parameter><br> </ac:structured-macro><br> </p><br> <ac:structured-macro ac:macro-id="9f271b8d-e796-4f57-b1fb-6285ed548ca1" ac:name="text-filter" ac:schema-version="1"><br> <ac:parameter ac:name="include">.*'%variable:currentpagetitle%'.*</ac:parameter><br> <ac:parameter ac:name="">content:body > body:text</ac:parameter><br> </ac:structured-macro><br> </ac:rich-text-body><br> </ac:structured-macro><br> <ac:structured-macro ac:macro-id="3817bcd8-f14d-4c2a-9324-65cebc0076de" ac:name="report-body" ac:schema-version="1"><br> <ac:rich-text-body><br> <p><br> <ac:structured-macro ac:macro-id="b191c203-3e3a-45d8-bec4-27d3dfadd4f5" ac:name="report-info" ac:schema-version="1"><br> <ac:parameter ac:name="link">true</ac:parameter><br> <ac:parameter ac:name="info">title</ac:parameter><br> <ac:parameter ac:name="">title</ac:parameter><br> </ac:structured-macro> - <ac:structured-macro ac:macro-id="521f10e8-e9e3-45a5-958a-424cdffe7d4f" ac:name="report-info" ac:schema-version="1"><br> <ac:parameter ac:name="format">yyy MMM dd - hh:mm (zz) </ac:parameter><br> <ac:parameter ac:name="separator">" "</ac:parameter><br> <ac:parameter ac:name="">modification date</ac:parameter><br> </ac:structured-macro> - <ac:structured-macro ac:macro-id="02faa252-4b67-4729-adfb-bf2672a80ca3" ac:name="report-info" ac:schema-version="1"><br> <ac:parameter ac:name="link">true</ac:parameter><br> <ac:parameter ac:name="">content:modifier > user:name</ac:parameter><br> </ac:structured-macro> - <ac:structured-macro ac:macro-id="bae8df66-4594-4eec-825f-93da129645f1" ac:name="report-info" ac:schema-version="1"><br> <ac:parameter ac:name="">content:body > body:text</ac:parameter><br> </ac:structured-macro><br> </p><br> </ac:rich-text-body><br> </ac:structured-macro><br> <ac:structured-macro ac:macro-id="328c16a8-2642-45b7-b186-74fc9935eb5c" ac:name="report-empty" ac:schema-version="1"><br> <ac:rich-text-body><br> <p>No articles have been found.</p><br> </ac:rich-text-body><br> </ac:structured-macro><br> </ac:rich-text-body><br> </ac:structured-macro><br>
(Edited)
Photo of Suresh Mathusuthanan

Suresh Mathusuthanan, Alum

  • 117 Posts
  • 9 Reply Likes
Hi Emmanuel, 

Your storage format seems truncated, some lines are missing. It would be great if you can send us the attachment of your storage format to support@servicerocket.com and we will continue our discussion via email.

Thank you.

Regards.
Suresh
(Edited)
Photo of Emmanuel Etasse

Emmanuel Etasse

  • 3 Posts
  • 0 Reply Likes
Hi Suresh,
I don't know how to attach the text-file so I try to paste directly in the message content

<ac:structured-macro ac:name="details" ac:schema-version="1" ac:macro-id="ffa0a9c3-189c-4bd4-9a2f-95eb1f4ddf5a"><ac:parameter ac:name="id">Description</ac:parameter><ac:rich-text-body><table class="wrapped"><colgroup><col /><col /></colgroup>
<tbody>
<tr>
<th>Env Name</th>
<td>HBAP1</td></tr>
<tr>
<th>XXXX Release</th>
<td>R8.4</td></tr>
<tr>
<th>SSS version</th>
<td>SSS.1.6 + HF3+ HF5</td></tr>
<tr>
<th>comments</th>
<td>&nbsp;</td></tr></tbody></table></ac:rich-text-body></ac:structured-macro>
<p><ac:structured-macro ac:name="report-variable" ac:schema-version="1" ac:macro-id="88473144-c59e-4cb3-bb59-fc68bddf46cb"><ac:parameter ac:name="name">currentpagetitle</ac:parameter><ac:parameter ac:name="value">%page:title%</ac:parameter><ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter><ac:rich-text-body>
<p>&nbsp;</p></ac:rich-text-body></ac:structured-macro>&nbsp;</p>
<p><ac:structured-macro ac:name="report-info" ac:schema-version="1" ac:macro-id="a4e6a553-e9ba-4346-bf22-c73885ba5f62"><ac:parameter ac:name="">variable:currentpagetitle</ac:parameter></ac:structured-macro></p>
<p>&nbsp;</p><ac:structured-macro ac:name="report-list" ac:schema-version="1" ac:macro-id="284bc48e-1176-4856-85ad-81a99b55a74d"><ac:parameter ac:name="maxResults">15</ac:parameter><ac:parameter ac:name="style">disc</ac:parameter><ac:rich-text-body><ac:structured-macro ac:name="content-reporter" ac:schema-version="1" ac:macro-id="3f632039-6940-4727-a882-661caa30b18b"><ac:parameter ac:name="types">page, comment, news</ac:parameter><ac:parameter ac:name="scope">XXXX Liquidity &gt; descendents</ac:parameter><ac:parameter ac:name="labels">estproj</ac:parameter><ac:rich-text-body>
<p><ac:structured-macro ac:name="date-sort" ac:schema-version="1" ac:macro-id="28d51f7d-f3ac-42a3-96aa-c5f17026f162"><ac:parameter ac:name="">modification date</ac:parameter></ac:structured-macro></p><ac:structured-macro ac:name="text-filter" ac:schema-version="1" ac:macro-id="24b7c68c-2a7d-4486-9787-d5d930dbc66d"><ac:parameter ac:name="include">.*'%variable:currentpagetitle%'.*</ac:parameter><ac:parameter ac:name="">content:body &gt; body:text</ac:parameter></ac:structured-macro></ac:rich-text-body></ac:structured-macro><ac:structured-macro ac:name="report-body" ac:schema-version="1" ac:macro-id="2dd157bc-e24b-4daa-a8a6-1daedd813c0b"><ac:rich-text-body>
<p><ac:structured-macro ac:name="report-info" ac:schema-version="1" ac:macro-id="cc1e126b-988d-4ba4-9673-94b8e4950875"><ac:parameter ac:name="link">true</ac:parameter><ac:parameter ac:name="info">title</ac:parameter><ac:parameter ac:name="">title</ac:parameter></ac:structured-macro> - <ac:structured-macro ac:name="report-info" ac:schema-version="1" ac:macro-id="32a1f32d-68e2-420f-a28e-c3ce1cd2bd5d"><ac:parameter ac:name="format">yyy MMM dd - hh:mm (zz) </ac:parameter><ac:parameter ac:name="separator">&quot; &quot;</ac:parameter><ac:parameter ac:name="">modification date</ac:parameter></ac:structured-macro> - <ac:structured-macro ac:name="report-info" ac:schema-version="1" ac:macro-id="8b3ed694-7f3e-4f7c-99ff-ba5545b36089"><ac:parameter ac:name="link">true</ac:parameter><ac:parameter ac:name="">content:modifier &gt; user:name</ac:parameter></ac:structured-macro> - <ac:structured-macro ac:name="report-info" ac:schema-version="1" ac:macro-id="ec9ac40c-8a4b-43d3-a6ba-9de8b01ff134"><ac:parameter ac:name="">content:body &gt; body:text</ac:parameter></ac:structured-macro></p></ac:rich-text-body></ac:structured-macro><ac:structured-macro ac:name="report-empty" ac:schema-version="1" ac:macro-id="18d2d664-9ed9-47f9-b688-5888b1cf8ec4"><ac:rich-text-body>
<p>No articles have been found.</p></ac:rich-text-body></ac:structured-macro></ac:rich-text-body></ac:structured-macro>
<h2>Follow up</h2>
<p>&nbsp;</p>
Photo of Suresh Mathusuthanan

Suresh Mathusuthanan, Alum

  • 117 Posts
  • 9 Reply Likes
Hi Emmanuel,

Excuse me for the delayed reply. 

We are currently investigating the injection, it would be great if you can share the following:
  • Reporting version
  • Confluence version 

Thank you.

Regards,
Suresh
Photo of Emmanuel Etasse

Emmanuel Etasse

  • 3 Posts
  • 0 Reply Likes
Hi Suresh,

Reporting 6.4.2
Confluence 5.10.2

regards
Emmanuel