home / skills / skillcreatorai / ai-agent-skills / jira-issues

jira-issues skill

/skills/jira-issues

This skill helps you create, update, and manage Jira issues via natural language, streamlining logging bugs, tasks, and backlog work.

npx playbooks add skill skillcreatorai/ai-agent-skills --skill jira-issues

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
4.8 KB
---
name: jira-issues
description: Create, update, and manage Jira issues from natural language. Use when the user wants to log bugs, create tickets, update issue status, or manage their Jira backlog.
license: MIT
---

# Jira Issue Management

Create and manage Jira issues using the Jira REST API or MCP.

## Setup

### Option 1: Jira MCP Server
Install the Jira MCP server for seamless integration:
```bash
npx @anthropic/create-mcp-server jira
```

### Option 2: Direct API
Set environment variables:
```bash
export JIRA_BASE_URL="https://yourcompany.atlassian.net"
export JIRA_EMAIL="[email protected]"
export JIRA_API_TOKEN="your-api-token"
```

Get your API token: https://id.atlassian.com/manage-profile/security/api-tokens

## Creating Issues

### Basic Issue
```python
import requests
from requests.auth import HTTPBasicAuth
import os

def create_issue(project_key, summary, description, issue_type="Task"):
    url = f"{os.environ['JIRA_BASE_URL']}/rest/api/3/issue"

    auth = HTTPBasicAuth(
        os.environ['JIRA_EMAIL'],
        os.environ['JIRA_API_TOKEN']
    )

    payload = {
        "fields": {
            "project": {"key": project_key},
            "summary": summary,
            "description": {
                "type": "doc",
                "version": 1,
                "content": [{
                    "type": "paragraph",
                    "content": [{"type": "text", "text": description}]
                }]
            },
            "issuetype": {"name": issue_type}
        }
    }

    response = requests.post(url, json=payload, auth=auth)
    return response.json()

# Example
issue = create_issue("PROJ", "Fix login bug", "Users can't login with SSO", "Bug")
print(f"Created: {issue['key']}")
```

### With Labels and Priority
```python
def create_detailed_issue(project_key, summary, description,
                          issue_type="Task", priority="Medium",
                          labels=None, assignee=None):
    payload = {
        "fields": {
            "project": {"key": project_key},
            "summary": summary,
            "description": {
                "type": "doc",
                "version": 1,
                "content": [{
                    "type": "paragraph",
                    "content": [{"type": "text", "text": description}]
                }]
            },
            "issuetype": {"name": issue_type},
            "priority": {"name": priority},
        }
    }

    if labels:
        payload["fields"]["labels"] = labels
    if assignee:
        payload["fields"]["assignee"] = {"accountId": assignee}

    # ... make request
```

## Common Issue Types

| Type | Use For |
|------|---------|
| Bug | Something broken |
| Task | Work item |
| Story | User-facing feature |
| Epic | Large initiative |
| Sub-task | Part of larger task |

## Updating Issues

### Change Status
```python
def transition_issue(issue_key, transition_name):
    # Get available transitions
    url = f"{JIRA_BASE_URL}/rest/api/3/issue/{issue_key}/transitions"
    transitions = requests.get(url, auth=auth).json()

    # Find matching transition
    transition_id = None
    for t in transitions['transitions']:
        if t['name'].lower() == transition_name.lower():
            transition_id = t['id']
            break

    # Execute transition
    requests.post(url, json={"transition": {"id": transition_id}}, auth=auth)
```

### Add Comment
```python
def add_comment(issue_key, comment_text):
    url = f"{JIRA_BASE_URL}/rest/api/3/issue/{issue_key}/comment"

    payload = {
        "body": {
            "type": "doc",
            "version": 1,
            "content": [{
                "type": "paragraph",
                "content": [{"type": "text", "text": comment_text}]
            }]
        }
    }

    requests.post(url, json=payload, auth=auth)
```

## Searching Issues

### JQL Queries
```python
def search_issues(jql):
    url = f"{JIRA_BASE_URL}/rest/api/3/search"
    params = {"jql": jql, "maxResults": 50}
    response = requests.get(url, params=params, auth=auth)
    return response.json()['issues']

# Examples
my_bugs = search_issues("project = PROJ AND type = Bug AND assignee = currentUser()")
open_items = search_issues("project = PROJ AND status != Done")
recent = search_issues("project = PROJ AND created >= -7d")
```

## Quick Commands

When user says... create this:

| Command | Action |
|---------|--------|
| "log bug about X" | Bug issue with description |
| "create task for X" | Task issue |
| "what's on my plate" | JQL: assignee = currentUser() AND status != Done |
| "move X to done" | Transition issue to Done |
| "add comment to X" | Add comment to issue |

## Best Practices

1. **Summary**: Keep under 80 chars, start with verb (Fix, Add, Update)
2. **Description**: Include steps to reproduce for bugs
3. **Labels**: Use for categorization (frontend, backend, urgent)
4. **Links**: Reference related issues when relevant

Overview

This skill lets you create, update, and manage Jira issues using natural language. It maps conversational commands to Jira REST API actions like creating issues, adding comments, transitioning statuses, and running JQL searches. Use it to log bugs, manage backlog items, and keep issue metadata consistent without manual API calls.

How this skill works

The skill translates plain-English instructions into Jira API requests or MCP server calls. It builds issue payloads (summary, description, type, labels, priority, assignee), runs transitions, posts comments, and executes JQL queries to fetch issues. Authentication is handled via environment variables or an MCP endpoint so requests are sent directly to your Jira instance.

When to use it

  • Log a bug quickly from a chat line item
  • Create a task or story without opening Jira UI
  • Update issue status or transition workflows
  • Add comments or attach metadata to an existing issue
  • Run JQL searches like "what's on my plate" to list assigned work

Best practices

  • Keep summaries under 80 characters and start with a verb
  • Include clear steps to reproduce and expected vs actual behavior for bugs
  • Add relevant labels for triage and filtering (frontend, backend, urgent)
  • Set priority and assignee when creating actionable tickets
  • Reference related issue keys and links in the description for context

Example use cases

  • "Log bug about login failure on iOS" → creates a Bug with reproduction steps
  • "Create task for onboarding docs" → creates Task with description, labels, priority
  • "Move PROJ-123 to Done" → queries transitions and performs the status change
  • "Add comment to PROJ-45: Waiting on design" → appends formatted comment to the issue
  • "Show my open items" → runs JQL to return issues assigned to current user and not Done

FAQ

How do I authenticate the skill with Jira?

Set JIRA_BASE_URL, JIRA_EMAIL, and JIRA_API_TOKEN as environment variables or connect via a Jira MCP server endpoint for seamless auth.

Can I control issue fields like priority, labels, and assignee?

Yes. The skill supports setting priority, labels, and assignee (by accountId) when creating or updating issues; include those in your natural-language request or supply explicit parameters.