Skip to content

About

Fill Jira with test / sample data

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Jira Test Data Generator

This project creates realistic Jira Software sample data for testing dashboards, reports, automations, and integrations.

It provisions one or more projects, creates sprints and versions over historical timelines, and seeds issues with varied quality patterns (healthy teams, bug-heavy teams, and messy legacy teams).

What This Repo Contains

  • post_sample_data.py: Main script that creates projects, sprints, versions, epics, and issues.
  • close_sprints.py: Utility script that closes any open/future sprints whose end date has passed.
  • jira.py: Jira REST API helper module used by both scripts.

Prerequisites

  • Python 3.11+
  • Jira Cloud site URL.
  • A Jira user with permission to:
    • Browse and create projects
    • Create and edit issues
    • Manage sprints on project boards
    • Create versions/releases
    • Create custom fields and add them to screens

Installation

Install dependencies (only requests is required):

pip install -r requirements.txt

Required Environment Variables

Set these in .env before running scripts:

  • JIRA_URL: Base URL for your Jira Cloud tenant (example: https://your-site.atlassian.net)
  • JIRA_EMAIL: Jira account email used for API authentication
  • JIRA_API_TOKEN: Jira API token for that account

Usage

Generate sample data

Run with defaults:

python post_sample_data.py

Defaults:

  • Projects: 3
  • Sprints per project: 26
  • Issues per sprint: 10
  • Random seed: 42

CLI options:

python post_sample_data.py \
  --projects 5 \
  --sprints 20 \
  --issues-per-sprint 12 \
  --seed 123

Full reset mode (destructive):

python post_sample_data.py --refresh

--refresh deletes existing target projects before recreating data.

Close overdue sprints

python close_sprints.py

This scans configured projects and closes open/future sprints that have an endDate in the past.

Default Projects

By default, the generator targets these project keys/names:

  • PROJA - Project A - SaaS Platform
  • PROJB - Project B - Data Pipelines
  • PROJC - Project C - Legacy Monolith

When --projects exceeds the built-in list, additional keys are generated (for example PROJ006, PROJ007, etc.).

Data Characteristics

The generator applies different project behavior profiles to produce varied analytics outcomes, including:

  • Different Story/Bug/Task ratios
  • Incomplete story point coverage
  • Late or missing resolution data
  • Backlog carryover and orphan issues
  • Version/fixVersion patterns
  • Optional sprint closure gaps

It also creates/uses:

  • Existing Story Points field
  • A custom TEST Resolution Date datetime field

Important Notes

  • Run this against a non-production Jira site.
  • API calls are concurrent and can be rate-limited by Jira; retry handling is included for common transient failures.
  • If a run is interrupted, rerunning with the same seed can help produce predictable data patterns.
  • The scripts are designed to be mostly idempotent for existing project keys, but --refresh is intentionally destructive.

Troubleshooting

  • User not found: verify JIRA_EMAIL matches an account in the target Jira site.
  • Auth failures (401/403): verify API token and account permissions.
  • Field/screen errors (cannot be set): ensure the account can manage fields/screens in the target projects.
  • Project create conflicts right after deletion: rerun after a short wait; Jira may still be propagating deletion.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

Fill Jira with test / sample data

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages