Chart macro - can it use JiraIssues macro results as source data somehow?

I'd like to use the chart macro to display some statistics regarding issues in Jira, but I can't figure out how I can get chart to access the resulting tickets of a Jira query.

I have been successful in getting chart to read data from an external page that contains a table as follows.

{chart:id=one|type=gantt|dataOrientation=vertical|columns=,1,2,3,4|displayData=after|width=800|dateFormat=yyyy-MM-dd|rangeAxisRotateTickLabel=true}
{include:Practice Sample CSV Data}
{chart}

However, the only way I am aware of to pull Jira issues is to use the jiraissues macro, which does not appear to provide any output formatting options.

{jiraissues:
   project=DS 
   AND component=QA_Tools
   AND status=Open
   }

The above jiraissues code sample will display the results in a dynamic window, though I don't see any way I can format the output into something the chart macro would understand.

Is there a way to get the output of a Jira query to be used as the source data for a chart?

5 answers

try using "renderMode=static" in the jiraissues macro. It is to turn the Jira Issues table to render in a non-dynamic mode. I could get the components listed, in a bar chart using this inside a chart macro. It didn't display the data but i think i was not using the right query for this kind of chart.

Since I could see my components listed on the chart, I'm hopeful it can work.

This doesn't quite seem to work for me.

I tried the following wiki code...

{chart:id=one|type=bar|dataDisplay=true|columns=1,2}

{jiraissues:
   project=PROJNAME 
   AND component=APPNAME
   AND fixversion="APPNAME-RB-2.0.0"
   | renderMode=static
   | columns=status;component;summary
   }
{chart}

...and what I end up seeing when it is rendered is something that looks a little like this...

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv


0.000 -------------------------

 
      -------------------------
       JIRA Issues (12 issues)
      [] status [] verified [] fixed

 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The "graph" part seems to be grabbing the header of the first column of data and then the values from the following rows in that column.

The rendered Jira issues (shown after the graph) looks something like this...

-----------------------------------
JIRA Issues (12 issues)
-----------------------------------
Status   | Component | Summary
-----------------------------------
Verified | APPNAME   | summary text 1
Fixed    | APPNAME   | summary text 2
Open     | APPNAME   | summary text 3

If there's a way to capture the Jira filter results into a normal table or .csv output, it looks like that would work much better...albeit, I haven't yet found a away to get info from the jiraissue macro in such a format yet - it seems kind of restrictive

You would think that Atlassian THEMSELVES would use this like mad! Dang it! I wish we had this. G.

I still have not figured out a way to accomplish this.

Still not resolved, but here's what I've tried so far...

Using the following syntax

{chart:id=one|type=line|dataDisplay=true|yLabel=Stuff|xLabel=Things|dataOrientation=horizontal|columns=1,2}
   {jiraissues: 
   project=PROJECT
   AND fixversion="things-RB-1.0.0" 
   | renderMode=static 
   | columns=status;component;summary 
   }
{chart}

The {jiraisues} macro results in a table with 2 header rows.

| JIRA Issues (45 issues)                     | 
| Status   | Component | Summary              | 
| Fixed    | app1      | fix thing 1          | 
| Fixed    | app1      | fix thing 2          |
| Verified | app2      | fix the whosiwhatsit |
| Resolved | app2      | fix the doohickey    |

The chart drawn based on this table shows

* "Stuff" as the vertical label

* "Things" as the horizontal label

* no data points

* a legend which shows a diff color for each of the following

* Status

* Fixed

* Verified

* Resolved

I would expect to see "Fixed", "Verified" and "Resolved" - but "Status" is actually a column heading in the table drawn out by the {jiraissues} macro.

It seems as if this might be a step closer to workable if there is some way to disable the top row of the table output by {jiraissues}

This is an old thread, but, as I wanted to do the same thing now in 2013, I'll post my answer in hopes it will help someone else. the only way I've found, short of writing a Jira Gadget to display what you want and importing it into Confluence, uses Bob Swift's XSLT macro. What I did:

Embed the XSLT macro inside a Chart macro. In the XSLT macro, point the source to the URL for the XML view of your Jira Filter or JQL query. I use an XSL file saved as an attachment in Confluence. Have the XSL output wiki format data. Here is a sample XSL file to create a table to display a summary of the statusses of the issues output from a filter:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" />
<xsl:strip-space elements="*"/>

<xsl:template match="channel" >
    <!-- Write the headings  -->
    <xsl:text>||status||count||</xsl:text>
    <xsl:text>
</xsl:text>
    <xsl:apply-templates select="item">
        <xsl:sort select="status"/>
    </xsl:apply-templates>
</xsl:template>

<xsl:template match="item" >
    <xsl:if test="not(preceding-sibling::item/status = current()/status)">
        <xsl:text>|</xsl:text>
        <xsl:value-of select="status" />
        <xsl:text>|</xsl:text>
        <xsl:value-of select="count(/*//item[status = current()/status])" />
        <xsl:text>|
</xsl:text>
    </xsl:if>
</xsl:template>
</xsl:stylesheet>

Here's the output from the XSLT for a sample filter:

||status||count||
|Failed|1|
|In Progress|1|
|Not Started|4|
|Passed|1|

Unfortunately, the XSLT macro doesn't use Conflunce-Jira authenticated application links, so this only works with Jira views/queries that are accessible anonymously.

The XSLT macro is part of the HTML Plugin for Confluence

You can use Chart from Table macro from Table Filter and Charts add-on to build charts based on Jira Issue macro.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,847 views 12 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot