Hi,
is there a possibility to use Page properties as filter criteria in "Jira Issue/Filter" macro?
I have some confluence-pages where some information from jira issues is displayed using some Jira Issue/Filter-macros.
I'd like to define some filter criteria once in the page, all jira-filter should use this attribute.
e.g:
Hello @Andreas Eder,
It seems that you have a quite special request
I can propose for it our app User Macro for Confluence Cloud
If I understand you correctly, you have a page. The page has page property. The page property should be used in JQL for searching (and representing) issues from Jira.
Here is how I did it with our app.
Our Jira and JQL with the word "site":
I have added to the target page property "filter" with the value "site"
And now the most interesting, I have created a new User Macro which
## the key of the property we are looking for
#set($propertyKey = "filter")
## get all properties for the current page
#set($properties = $ConfluenceManager.get("/wiki/api/v2/pages/${page.id}/properties").results)
## looking for our property one-by-one
#foreach ( $property in $properties )
## check if current property same as $propertyKey
#if ($property.key == $propertyKey)
## store the value int $filter variable
#set($filter = $property.value)
#end
#end
## setup JQL with the $filter value
#set($jql = "text ~ '${filter}' AND project = TEST ORDER BY created DESC")
## making Jira search
#set($issues = $JiraManager.get("/rest/api/3/search?jql=${jql}").issues)
## show results as a simple table
#set( $jiraUrl = $StringUtils.remove($baseUrl, "wiki/") )
<table class="aui aui-table-sortable">
<thead>
<tr>
<th class="aui-table-column-issue-key">Issue key</th>
<th>Summary</th>
<th>Status</th>
<tr>
</thead>
<tbody>
#foreach ( $issue in $issues )
<tr>
<td><a href="${jiraUrl}/browse/${issue.key}">$issue.key</a></td>
<td>$issue.fields.summary</td>
<td>$issue.fields.status.name</td>
</tr>
#end
</tbody>
</table>
On the app code looks much better
And the final result: list of issues listed on the page
I hope, I understand you correctly and this is what you need.
User Macro app provides a lot of possibilities for custom logic, integration, and representation.
Regards,
Roman, CEO of Wombats Corp
Hello Roman,
It's nearly a possible solution, we use confluence data center.
I'll search for possible macro-apps.
I hoped there is an other way to re-use jira-filters in confluence pages :)
We use confluence to report data periodically, this pages contains many jira-filters. The only difference are some filter criteria. (e.g. resolved-time, fix-version). Currently, I have to adapt any filter manually - on the one hand, this requires a certain amount of effort, on the other hand, there is a risk of error.
Regards,
Andreas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
On DC you have User Macro out-of-the-box and can create that thing from the admin page
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you,
As far as I understood, I need a macro for each Jira-Filter.
I'll give this a try and test macros.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can write one macro and then parametrize it via User Parameters
So on adding the macro, the user specifies a parameter (JQL or/and property-key)
One macro will fetch different data based on the User Parameter, however, display it with the same logic
I'm pretty sure that you can achieve it within DC User Macro.
In any case, you can reuse my code partially (it has ~80% compatibility).
The main pitfall is finding a way to fetch data from Jira into Confluence via macro...
Regards, Roman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.