Collection of node scripts to query, store, and report on Jira issues.
- Timeline: See the history of an issue using vis-timeline.
Here's a full timeline, showing all change events:
Here's a filtered timeline - just add the fields you want to see as the value of the "field" query parameter (e.g.
?field=status,labels,Component,priority,assignee,issuetype
): - Estimate Report: See which Stories have/have not been estimated
- User Report: See progress on Stories, per Assignee
- Graphical display of issue links (using Mermaid)
- JSON/HTML list of projects (with or without issue type counts)
- JSON/HTML list of fields (standard & custom)
-
git clone https://github.com/jolewis-ddn/jira-status-reporter cd jira-status-reporter npm install mkdir data
- Copy (or rename)
default-template.json
todefault.json
- Update the values in
default.json
as appropriatefa
is optional and must include the full URL to your FontAwesome JavaScript kit - e.g. ,"fa": "https://kit.fontawesome.com/0123456789.js"
- If you enable FontAwesome, you may wish to adjust the faIcons object to point to different icons.
- All others fields are required
- Create the database (where DATABASE_NAME is set in the config file (or dataPathPrefix + 'jira-stats.db' by default))
-
cd $dataPath sqlite3 DATABASE_NAME >.read ../jira-stats.sql >.quit
-
node app.js
?flush=yes
is available for many endpoints to force a cache refresh. Note: this will wipe out the cache for all users
/
: no-op
/components
: Unique and sorted list of all the Components/config
: Current config/fields
: All Jira fields (standard and custom)
/requirements
: Requirements report (cached)
/estimates
: List which Stories have been estimated (cached)
/chart
: Visualize timeseries data using cache/dashboard
: Data visualization of current status (no cache)/epics
: Visualize Epic status (includes linked issues)- Parameters:
id
: Jira key value (Required; no default)release
: Only include issues that have a matching fixVersion.Name value. No value supplied = no filter (Optional; no default)
- Note: response is cached on the first request.
- Parameters:
/filter
: Visualize issue status using existing Jira filter/issueTypes
: List of issue types (either project-specific or global)/links
: Visualize issue links/remainingWorkReport
: Per-issue work left for specified release. [See config option "workInSubtasksOnly" for important information impacting this report.]/report
: Simple data report on issue statuses over time (epic count, open issue count, updates this month/week, etc.)/timeline
: Show the history of an issue (uses vis-timeline)/unestimated
: Table showing the number of unestimated Stories (with a link to Jira)
/burndown
: Burndown charts (with optional forecast) for all issues or specific release and/or Component/releases
: List of versions (cached); links to /progress/progress
: Release progress report (parameter: release ID)
/groups
: Shows a list of groups.?format=html
to see the list in HTML (unordered list)?filter=yes
to see the subset (as specified by the userGroups config value)- If userGroups array is set in the config, it will be excluded (and the members of the remaining groups will be fetched).
- If userGroups is not set, the full list of groups (without members) will be fetched.
/cache/stats
: All dates covered by cache/cache/flush
: All dates covered by cache
/dates
: All dates covered by cache/homedir
: The current root cache folder/series
: Issue counts by status/cacheJSR
: Current in-memory cache/datafilesJSR
: List of data files in cache/rebuild-cacheJSR
: Delete and recreate the cache from source data/refresh-cacheJSR
: Update the cache with new source data files/reread-cacheJSR
: Re-read the cache from disk/resetJSR
: Re-initialize the cache/update-cacheJSR
: Add missing files to the cache/wipe-cacheJSR
: Delete the cache
- Collect status for a specific month:
./getIssueCountsByMonth.sh <month-number>
(e.g.6
for June) - Collect stats for a specific status and month:
node getIssueCountsByStatusAndMonth.js -s ICEBOX -m 6
- Pull all Jira issue data for all statuses from yesterday and store as JSON files in
./$dataPath/
:./pullDataForYesterday.sh
- ** Warning ** This can result in significant data storage, depending on your Jira project size
- Run the status server
- Production:
npm run server
- Debug:
npm run server-debug
- Open http://localhost:9999/chart to see the default chart (use server.port as set in your config file)
- You can specify alternate configurations by setting NODE_ENV.
- For example, if a config file named
Production.json
exists in theconfig
directory, setting NODE_ENV toProduction
before runningJiraStatusServer.js
will pick up the values fromconfig/Production.json
(orconfig/Production.yaml
or any other config file supported bynode-config
(see above).)
- For example, if a config file named
The following elements can be set in the config file:
- jira:
- protocol:
http
orhttps
- host: Jira server hostname
- username: Full Jira username
- password: User password or token with sufficient rights to execute the queries
- apiVersion: Set to the integer or
latest
- protocol:
- server: Local server port
- graphicServer
- project: Jira project as the default
- dataPath: Relative path to data files (Default: 'data')
- ignore
- fa: Font Awesome link (full URL, including
.js
) - forecast
- teamSize: Additional forecast line on burndown chart based on team size
- userGroups: Groups in Jira which are commonly used; membership is fetched only for groups in this list
- userExclude: Individuals to not include in userGroup membership (type: array)
- releaseExcludeTypes: Status(es) to exclude from the Progress Report (type: array) [Note: this has the same result as using the
exclude
query parameter, but cannot be overridden by the end user.] - adminKey: Parameter to enable/display administrative functions
- issueTypes: Optional list of specific issue types. (Default: Epic, Story, Task, Sub-task, Bug, Test)
- unassignedUser: String to represent unassigned items. May be used in various reports (including remainingWorkReport). (Default: 'UNASSIGNED')
- workInSubtasksOnly: Boolean indicating whether or not Stories contain work in addition to work in Sub-Tasks. If this value is true then Stories that contain Sub-Tasks do not contain work in themselves (i.e. all work is in the Sub-Tasks). If this value is false then Stories may contain work above and beyond work estimates in the Sub-Tasks. (Stories without Sub-Tasks are always included.) This is currently only honored by the Remaining Work Report, which now shows, at the top of the report, a string indicating this value: "Stories with Sub-Tasks are shown/included" (false) or "Stories with Sub-Tasks are not shown/included" (true). (Default: false)
- extraLinks: Object of additional links to be listed on the home page. The keys are the displayed names; the values are the HREFs. (Default: none)
- All node scripts have a help page:
node script.js --help
To turn on debug output, set the DEBUG
environment variable, like so:
set DEBUG=*
./$dataPath/
: Where the database and all JSON files will be stored (dataPath is set in Config file; default = 'data')./.cache/
: Project data (JSR) cache
JiraStatusServer.js
: Run a local server for handling queriesJiraStatusReporter.js
: The main Javascript class*.sh
: Shell-wrappers for the Javascript filespullDataForYesterday.sh
queries and stores all Jira issues by Status for the prior calendar day. All data is stored in./$dataPath/*.json
files with the Status and date in the filename.
get*.js
: Query (and store) Jira issue details (counts or data)getIssueCounts*
only return a total numbergetIssues*
return the full Jira issue data
jira-stats.sql
: Table definition for local jira stats
- Node modules
jira-client
: Main Jira client toolcommander
: For parsing command line optionsrestify
: Forsimple-server.js
debug
: For loggingsupports-color
: Fordebug
date-fns
: For date manipulationava
: For testingistanbul
: For test coveragerando.js
: For random chart IDsnode-config
: Manages configurationnode-cache
: Manages general cache
- Working QuickChart server
- See https://quickchart.io/ for instructions
- Configure the server and port in the config.js file
Distributed under the MIT license. See LICENSE
for more information.