Confluence Variables in modified JQL macro

Raynard Rhodes
Contributor
July 18, 2019

I've followed the instructions here

I am able to create a template, create a variable, insert the modified Jira/JQL Macro, and use the template.

I am prompted to enter the value for the variable, but the variable I've placed inside the JQL macro becomes empty. This seems to be because the JQL is rendering before the value is entered in the variable.

Is there a way that I can use variables inside of the JQL macro?

 

JQL Macro Template:

## @param maxRows:title=Max Rows|type=int|required=true|default=20|desc=Enter the max rows, anything above 1000 will only display 1000 rows.
## @param columns:title=Columns|type=string|required=true|default=key,summary,type,status,assignee|desc=Enter the columns you want returned. Must be separated by commas, all lowercase, and no quotes. e.g. key,summary,assignee,test author,reporter
<p>
<ac:structured-macro ac:name="jira" ac:schema-version="1">
<ac:parameter ac:name="server">JIRA</ac:parameter>
<ac:parameter ac:name="columns">$paramcolumns</ac:parameter>
<ac:parameter ac:name="maximumIssues">$parammaxRows</ac:parameter>
<ac:parameter ac:name="jqlQuery">$body</ac:parameter>
<ac:parameter ac:name="serverId">SERVERID</ac:parameter>
</ac:structured-macro>
</p>
 

 

This is the template page with the variable being created outside of macro and variable being used inside of macro.

======================================================

template_assistance.PNG

 ========================================================

 

When I create a new page based on the "Testing JQL Macro" template, the JQL will resolve itself and since $assignee hasn't been initialized yet, it returns an error.

=========================================================

template_assistance2.PNG

=========================================================

 

template_assistance3.PNG

 

 

If I manually complete the query it functions. I would like to be able to enter the value of the variable without the macro resolving prior to.

1 answer

1 accepted

0 votes
Answer accepted
Raynard Rhodes
Contributor
July 22, 2019

At this point I'm going to assume there is no way to delay the macro from resolving before the value is entered.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events