Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Confluence - display 'JIRA count issues' in custom format

ernest snaith
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 25, 2018

I would like to query the number of issues meeting certain criteria in JIRA and display the result simply as a number amongst text.

E.g. I have a custom issuetype in Jira called 'TechnicalQueries'. I would like to be able to display the following in Confluence. 'There are currently 34 open Technical Queries'.

I have seen the count jira issue macro but is appends the word issue to the end, Is there a better more flexible way to add in line queries?

1 answer

1 vote
Sattesh M
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 18, 2018

Hello @ernest snaith,

If you don't mind a little hack, you could do this.

  1. Shut down Confluence.
  2. Look for the confluence-jira-plugin-X.X.X.jar file in the (Confluence Installation Directory)confluence\WEB-INF\atlassian-bundled-plugins.
  3. Make a copy of the file for safe keeping, and extract the JAR file using an archive extractor to a folder.
  4. Inside the extracted file, go to (confluence-jira-plugin-X.X.X)\templates\extra\jira, and look for the staticShowCountJiraissues.vm file.
  5. Edit that file, and edit the middle portion so it becomes as below.
     #else
    <a class="issue-link" href="$clickableUrl">
    #if($count == "1")
    $i18n.getText("$count")
    #else
    $i18n.getText("$count")
    #end
    </a>
    #end
  6. We can clean up the code a bit if needed, since we're going to be displaying the same content, even if the count is equals to 1, or anything else, but we can just leave it as it is, which makes future edits simpler.
  7. Now, archive the whole thing back into a JAR file.
  8. Replace the original confluence-jira-plugin-X.X.X.jar file, with our newly edited confluence-jira-plugin-X.X.X.jar file.
  9. Clear the Confluence plugin cache as per the guide here.
  10. And now, when we use the count feature, it should only show the number, and not the issue, or issues post-fix.

Do try, and let me know how it goes, and make sure to create the back of the file above, in case we need to roll back.

Do note that upgrading Confluence would break this, and we will have to re do it for the new confluence-jira-plugin-X.X.X.jar file that comes with the upgraded Confluence.

Hope this helps, and do let me know if you have any questions.

Cheers,
Sattesh

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events