Skip to content

Repository files navigation

Symfony Jira Ticket CLI Importer

A focused Symfony Console application to import Markdown files from a directory into Jira Cloud as issues.

Requirements

  • PHP >= 8.4
  • Composer

Installation

  1. Clone the repository.
  2. Install dependencies:
    composer install

Configuration

The application is configured via environment variables. You can set these in a .env.local file or in your system environment.

Variable Description Default
JIRA_BASE_URL Your Jira Cloud instance URL (e.g., https://your-domain.atlassian.net) -
JIRA_EMAIL The email address associated with your Jira account -
JIRA_API_TOKEN Your Jira API token -
JIRA_PROJECT_KEY The Jira project key where tickets will be created -
JIRA_DEFAULT_ISSUE_TYPE The default issue type for created tickets Task

Usage

Run the following command to import Markdown files:

php bin/console app:create-jira-ticket <markdown-directory>

Behavior

  • The command discovers .md files directly inside the provided directory.
  • It does not scan subdirectories recursively.
  • Each file is rendered using a Twig template located at config/jira/ticket-template.md.twig.
  • The first H1 heading (# Heading) in the Markdown file is used as the Jira issue summary. If no H1 is found, the filename (without extension) is used.
  • The command continues processing even if individual file imports fail.
  • A summary is provided at the end of the run.

Example Output

✓ ticket-a.md -> PROJ-123
✗ ticket-b.md -> Jira API error: [status code 400] ...

Processed: 2 Created: 1 Failed: 1

Development and Testing

The project includes several quality tools accessible via Composer:

  • Run tests:
    composer test
  • Static analysis (PHPStan):
    composer phpstan
  • Code style check (PHPCS):
    composer phpcs
  • Code style fix (PHPCBF):
    composer phpcbf

Template Customization

You can customize how tickets are rendered in Jira by editing config/jira/ticket-template.md.twig. The template has access to:

  • filename: The name of the Markdown file.
  • content: The raw content of the Markdown file.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages