Confluence Variables in JIRA JQL macro
Asked by lukasz_switaj:

Hello,

I create release notes pages from template (env - **cloud**).

Those contain a few (between 3 and 7) JIRA macros. I'd like to fill it automatically once I provide the version number (ideally under the variable $version). Is it possible somehow? Do you have such function (using confluence variables in JIRA macros) on your roadmap? Doing it from some Wizzaird level would be also fine.

Also, it would be great to include such info (version) in the page name.

On the attached screenshot you can see: what's the current state -\> what's the goal:![Screenshot 2020-05-18 at 00.44.26.png](/t5/image/serverpage/image-id/95208i4AC4FB8C21B0CB54/image-dimensions/372x303?v=v2 "Screenshot 2020-05-18 at 00.44.26.png")


Answers:
author: Ignacio Pulgar
body: Hi [@lukasz_switaj](/t5/user/viewprofilepage/user-id/3925739) ,

There's no way of doing so natively.

On Server instances, there's a workaround by using the [Confluence Source Editor](https://marketplace.atlassian.com/apps/1210722/confluence-source-editor?hosting=server&tab=overview) free app, as it allows to search \& replace the fixVersion value.

On Cloud instances, I've just seen this [Source Editor for Confluence](https://marketplace.atlassian.com/apps/1215664/source-editor-for-confluence?hosting=cloud&tab=overview) app, which seems to be quite similar to its Server counterparty, but I've not tried it yet.

Hope it helps.

comments: author: lukasz_switaj
body: Thanks for the response, Ignacio.  
Do you think that in such a case the free option doesn't exist? (cloud)  
Maybe there is an alternative way of doing that. Writing own macro, or sth like that? Do you have some ideas?


author: Ignacio Pulgar
body: You are welcome, [@lukasz_switaj](/t5/user/viewprofilepage/user-id/3925739) :)

I'm afraid there's no free version of that addon for Confluence Cloud, and I do not know of any other alternatives.

I think this kind of goal would require to develop your own Confluence Cloud app for getting something like that, although I'm not 100% sure of that.

Which I would recommend to do is a workaround based on doing things differently:

1. Save a filter named ie: *version report* with this JQL: *fixVersion = 1.3.0*
2. Create and save the filters you set in the macros with the same JQL, except that you should substitute *fixVersion = 1.3.0* with *filter = "version report"*
3. Create a dashboard in Jira with gadgets instead of macros, and feed them with the filters you saved in the previous step

After having followed these steps, you will have something similar to your macros, and you will be able to update all filters at once by changing the fixVersion of your *version report* filter.

(This way of referencing a saved Jira filter is also available within Confluence macros)

Once you have the dashboard displaying all the relevant data related to a given version, select all gadgets content with your mouse and Copy (Ctrl + C).

Go to a Confluence page where you would like to store your version report, enter its edit mode, and Paste (Ctrl + V).

By creating the page this way, you will get a static snapshot of the data, as opposed to dynamic data which would vary over time if the issues in the report changed.

That's usually good, because as time passes, you will retain the picture taken at a certain point in time, which is usually the best approach for this kind of reports.

Hope it helps.


author: Ignacio Pulgar
body: Of course, once you have to build a new report for the next version, you just have to change and save just your *version report* filter, and just copy and paste the new data into a new Confluence page.

You may need to apply some manual adjustments to the pasted content, but it will save you tons of time when creating this kind of version reports.

Best regards.


author: Rodri Alvarez
body: Hi guys,

Thanks for this hint! I currently have a similar "issue" I have a confluence page with multiple JIRA SQL Macros in there. I want to take some value from the confluence page as a variable for the fix version for all these JIRA SQL queries. I have the editor, is there any way to do that?

Thanks


author: Ignacio Pulgar
body: Hi [@Rodri Alvarez](/t5/user/viewprofilepage/user-id/3050381) ,

If you have the editor, then you just need to enter the source like shown in the screenshots here:

[https://marketplace.atlassian.com/apps/1210722/confluence-source-editor?hosting=server\&tab=overview](https://marketplace.atlassian.com/apps/1210722/confluence-source-editor?hosting=server&tab=overview)

Then just use the Find and Replace fields shown in the second screenshot to substitute one version name with another one.

Regards!


Tags: cloud

jira

jql

template

variable