A simple command-line tool to create Jira issues in a Cloud instance. This tool is designed to be easily integrated with Cursor's AI capabilities.
- Create Jira issues with explicit arguments
- Supports Jira Cloud instances
- Uses Atlassian Document Format for descriptions
- Supports both Bug and Task issue types
- Sets High priority by default
- Provides clear error messages and output
- Rust and Cargo installed
- Jira Cloud instance
- Jira API token
- Jira account email
- Clone the repository
- Create a
.envfile in the project root with your Jira credentials:
JIRA_DOMAIN=your-domain.atlassian.net
JIRA_API_TOKEN=your-api-token
JIRA_USER=your-email@example.comcargo install --path .Create a new Jira issue using the create command:
jira create --project <PROJECT> --summary <SUMMARY> --description <DESCRIPTION> [--issue-type <TYPE>]# Create a bug (default)
jira create --project SBT --summary "Fix login page bug" --description "The login page is not working properly"
# Create a pbi (case insensitive)
jira create --project SBT --summary "Implement dark mode" --description "Add dark mode support" --type pbiLog time spent on a Jira issue:
jira log-time --issue-key <ISSUE_KEY> --minutes <MINUTES> [--comment <COMMENT>]# Log 2 hours (120 minutes) with a comment
jira log-time --issue-key SBT-123 --minutes 120 --comment "Implemented dark mode toggle"
# Log 30 minutes without a comment
jira log-time --issue-key SBT-123 --minutes 30
# Log 1 hour for work done on a specific date
jira log-time --issue-key SBT-123 --minutes 60 --date "2024-01-15" --comment "Work from last week"log-time: Command to log time spent on an issue--issue-key: The key of the Jira issue (e.g., "SBT-123")--minutes: Time spent in minutes--comment: Optional comment about the work done--date: Optional date when the work was done (format: YYYY-MM-DD)
create: Command to create a new issue--project: The key of the Jira project where the issue will be created (e.g., "SBT")--summary: The summary/title of the issue--description: The detailed description of the issue--type: Type of the issue (bug or pbi, case insensitive), defaults to bug
The tool will output:
- The URL of the created issue
- The issue key
- The issue summary
Example output:
Created issue: https://your-domain.atlassian.net/browse/SBT-123
Key: SBT-123
Summary: Fix login page bug
To run the tool during development:
cargo run -- create --project <PROJECT> --summary <SUMMARY> --description <DESCRIPTION> [--issue-type <TYPE>]The tool will display appropriate error messages if:
- Environment variables are missing
- API request fails
- Invalid project key is provided
- Other API-related errors occur
Cursor can use this tool to create Jira issues directly from the editor. Here are some example prompts for Cursor:
- Create a bug report:
Create a Jira bug for the login page issue with the description "Users cannot log in after password reset"
- Create a task:
Create a Jira task for implementing dark mode in the application
The tool will automatically:
- Format the description in Atlassian Document Format
- Set the issue type (Bug or PBI)
- Set the priority to High
- Provide the issue URL and key in the output
.
├── src/
│ ├── main.rs # Main CLI implementation
│ ├── commands.rs # Command definitions
│ └── jira.rs # Jira API client implementation
├── Cargo.toml # Project dependencies
├── .env # Environment variables (not in version control)
└── README.md # This file
- clap: Command-line argument parsing
- reqwest: HTTP client
- serde_json: JSON handling
- dotenv: Environment variable management
- chrono: Date and time handling
MIT