changelogen-jira-plugin
v0.1.0
Published
JIRA integration plugin for changelogen
Downloads
136
Maintainers
Readme
Changelogen 💅 JIRA Plugin
A JIRA integration plugin for changelogen that automatically detects and links JIRA tickets in commit messages.
Features
- 🎯 Automatic Detection: Finds JIRA ticket references in commit messages and bodies
- 🔗 Smart Linking: Generates clickable links to JIRA tickets in changelogs
- ⚙️ Configurable: Customize project keys, base URL, and ticket patterns
- 🚀 Zero Dependencies: Lightweight plugin with no runtime dependencies
- 📝 TypeScript: Full TypeScript support with type definitions
Installation
npm install changelogen-jira-plugin
# or
pnpm add changelogen-jira-plugin
# or
yarn add changelogen-jira-pluginUsage
Add the plugin to your changelog.config.js:
export default {
plugins: {
"changelogen-jira-plugin": {
baseUrl: "https://your-company.atlassian.net",
projectKeys: ["PROJ", "TASK", "BUG"],
},
},
};Configuration
Required Options
baseUrl(string): Your JIRA instance base URLprojectKeys(string[]): Array of JIRA project keys to match
Optional Options
ticketPattern(RegExp): Custom regex pattern for ticket matching- Default:
/([A-Z]+-\d+)/g
- Default:
Example Configuration
export default {
plugins: {
"changelogen-jira-plugin": {
baseUrl: "https://company.atlassian.net",
projectKeys: ["FRONTEND", "BACKEND", "INFRA"],
ticketPattern: /([A-Z]{2,}-\d{3,})/g, // Custom pattern
},
},
};How It Works
The plugin scans commit messages and bodies for JIRA ticket references that match:
- The configured
ticketPattern(default: uppercase letters, dash, numbers) - One of the specified
projectKeys
Example Commit Processing
Input commit:
feat: add user authentication FRONTEND-123
Implements OAuth2 flow for user login.
Also fixes BACKEND-456 API endpoint.Output in changelog:
- Adds clickable links:
FRONTEND-123→https://company.atlassian.net/browse/FRONTEND-123 - Adds clickable links:
BACKEND-456→https://company.atlassian.net/browse/BACKEND-456
TypeScript Support
The plugin is written in TypeScript and provides full type definitions:
import type { JiraPluginConfig } from "changelogen-jira-plugin";
const config: JiraPluginConfig = {
baseUrl: "https://company.atlassian.net",
projectKeys: ["PROJ"],
ticketPattern: /([A-Z]+-\d+)/g,
};Development
Setup
git clone <repository-url>
cd changelogen-jira-plugin
pnpm installScripts
# Build the plugin
pnpm build
# Run tests
pnpm test
# Run tests in watch mode
pnpm test:watch
# Lint code
pnpm lint
# Fix linting issues
pnpm lint:fixTesting
The plugin includes comprehensive tests covering:
- Ticket detection in commit messages and bodies
- Multiple tickets per commit
- Project key filtering
- Custom ticket patterns
- Preservation of existing references
Run tests with:
pnpm testContributing
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes and add tests
- Ensure tests pass:
pnpm test - Commit your changes:
git commit -m 'feat: add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
License
MIT License - see LICENSE file for details.
Related
- changelogen - The main changelog generator
- Conventional Commits - Commit message specification
