Populate JIRA Issues Macro with Variables (Template)
Asked by MollyJo Tighe:

Hopefully someone has tripped over this and has a neat solution, I've been spending an inordinate amount of time reading through forums and posts and have not found anything.

My team and I create an Internal Release Notes document for each version release (I have created a template). However, we create these at the beginning of a release cycle, at the end of which there could be more or less issues (bug fixes for that release, etc.)

I've been trying to template this so that if the creator types in some variables (project ID, fixVersion) then the Jira Issues Macros would populate using pre-set queries needing just those variables. Having this work would be great, because I can also display particular fields in the table on top of the dynamic nature of this macro.

However, this does not seem to be a thing that is possible. I've even looked at addons but have not found anything that will do this for me.

Closest I've gotten is by pre-writing the query and then injecting it with wiki mark-up, but even that does not always work and requires manual intervention. Example: jiraissues:jqlQuery=project=![$project](https://rosieapp.atlassian.net/wiki/plugins/servlet/confluence/placeholder/template-variable?name=project) and fixVersion=![$jiraversion](https://rosieapp.atlassian.net/wiki/plugins/servlet/confluence/placeholder/template-variable?name=jiraversion) and affectedVersion is EMPTY\|columns=Epic Link;Key;Type;Summary;QA Summary;Status;Labels;Linked Issues;Affected Department(s)\|title=Stories\|cache=off

Has anyone tried to do this and succeeded? I'll take anything short of writing a macro myself - I'm just not at the point to be able to do that quickly without significant help or time (or both). Additional blocker - we are on Confluence Cloud.


Answers:
author: MollyJo Tighe
body: Update.  

This is now even worse with the new Confluence pages. Even ignoring the fact that variables are simply not working correctly at all, there is now no ability to pre-write the query I need and use wiki markup to quick manually switch it.  

So this is completely unable to be automated.


author: Ann King
body: On JIRA server instances, I used to achieve this using edit source and then find and replace to update any input parameters/variables. It looks like JIRA cloud does not have the edit source for a confluence page; but, I did see some options in marketplace.


author: Stephen Sifers
body: Hello MollyJo,

The concept of having pages that create based on dynamic values is something I really appreciate and can understand how helpful and versatile it would be to have. Out of the box, the product will not accommodate what you're wanting to do (outside of [How to document releases and share release notes](https://confluence.atlassian.com/doc/blog/2015/10/how-to-document-releases-and-share-release-notes)). There are two options that come to mind, one is using an app with Confluence and the other is creating a custom blueprint for Confluence templates.

As far as apps go with Confluence, it would be possible to use a SQL macro to access data based on passed through values. This type of integration does not suit some instances due to easily access data across roles. However, it does allow you to access data very quickly. You can explore using SQL macros via a preset marketplace search for [Atlassian Marketplace \| SQL](https://marketplace.atlassian.com/search?product=confluence&query=sql).

The other option will require some developer time to create a custom blueprint to use within Confluence which (depending on how you configure the blueprint) may allow for users to insert values and build the page based off of these values. More about blueprint may be found at [Blueprints](https://confluence.atlassian.com/doc/blueprints-323982376.html).

While not a direct answer on how to deploy your needed solution, I do hope the reference material proves helpful in exploring what additional options you have outside the base of the product.

Regards,  
Stephen Sifers

comments: author: MollyJo Tighe
body: Hi Stephen,

I'm not sure how much this would work against my configuration, as we are a Cloud installation as opposed to a server. I explored Blueprints, but they require more development knowledge then I can really spend time on learning in the immediate timeline, and it looks like most if not all of those SQL addons require the database to be hosted/managed by us.

Thank you though,

- Molly


author: Julian Mullins
body: [@Stephen Sifers](/t5/user/viewprofilepage/user-id/2145523) wanted to check in as well - I'm attempting to do the same thing here (filter a JIRA issue search given the value of a template variable) and can't find any easy way to do this (I'm using JIRA Cloud as well).  

Is this on the roadmap? Is there any dev ticket I could follow / upvote?


author: Stephen Ellwood
body: Yet another document automation feature that is missing from Confluence it seems? I am trying to do the same thing, change the product of a Jira search query based on variables supplied when instantiating a template instead of finding all instances of a product within the page after applying the template and changing them by hand.


Tags: atl-adm

cloud

confluence-cloud

macro

template