Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Is there a way to pull daily data from Jira and add to a Confluence chart?

barbarat January 21, 2015

I'm trying to show on a chart:

  1. Issues resolved on a daily basis
  2. Issues opened/unresolved on a daily basis (same chart so we can see where they converge).

Is there a way to pull the data from JIRA by date/day?

Trying to look at the history data for the past week and don't know how to pull #issues resolved (or open issues) on say 1/15/15, then 1/16/15, etc.

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 24, 2015

If you are using server instances, then the easiest way is to use the SQL Macro and run the appropriate query against the JIRA database. Wrap the results in the chart macro. 

If you are using cloud instances it is a bit more involved. There are other ways to extract data from JIRA, including using the getIssueList from JIRA Command Line Interface (CLI). The csv can be published to Confluence and displayed using the CSV macro. Or you can do some scripting to extract out data to publish to Confluence for charting.

For my Cloud site, I extract data to a small local database and publish data to Cloud Confluence (see How to publish SQL queries to Atlassian Cloud).  

Have you tried using some of the JIRA gadgets in Confluence that are available that provide some charts? See Adding JIRA Gadgets to a Confluence Page.

0 votes
Sascha Becker January 21, 2015

You can either write an external script that gets that data via REST-Api each day or inside JIRA you could use scheduled tasks or write a service.

Problem with services is that if you restart JIRA their timer gets reset. Lets say you write a service that runs every 24 hours at night. If you restart during the day, the service will start again and then restart itself in the middle of the day every 24 hours. 

Since that is problably not what you want, consider scheduled tasks.

public class ExampleScheduledJob implements Job {
	public void execute(JobExecutionContext context) throws JobExecutionException {
		// this method gets executed every time the job runs. Put your code here
	}
}

Package that file in a JAR and deploy it under WEB-INF/lib folder. Modify the scheduler-config.xml file under WEB-INF/classes so that JIRA knows about the task and how to schedule it.

<job name=ExampleJob" class="com.exampleproject.jira.ExampleScheduledJob" />
<trigger name="ExampleJobTrigger" job="ExampleJob" type="cron">
	<expression>0 0/2 * * * ?</expression> <!-- run every two minutes -->
</trigger>

You can also write scheduled tasks using the Shared Access Layer (SAL).

https://developer.atlassian.com/docs/atlassian-platform-common-components/shared-access-layer/scheduling-events-via-sal-tutorial

 

Hope my answer helps you. If it does please accept it here.

 

 

TAGS
AUG Leaders

Atlassian Community Events