Create Jira issues (story, epic, feature, task, bug, feature-request) with proper formatting
Creates Jira issues with proper formatting, templates, and parent linking for stories, epics, features, tasks, bugs, and feature requests.
/plugin marketplace add openshift-eng/ai-helpers/plugin install jira@ai-helpers<type> [project-key] <summary> [--component <name>] [--version <version>] [--parent <key>]jira:create
/jira:create <type> [project-key] <summary> [options]
The jira:create command creates Jira issues following best practices and team-specific conventions. It supports creating stories, epics, features, tasks, bugs, and feature requests with intelligent defaults, interactive prompts, and validation.
This command is particularly useful for:
Jira issues form a hierarchy. Understanding this hierarchy is critical for proper parent linking:
Feature (Strategic objective, market problem)
│
└── Epic (Body of work, fits in a quarter)
│
├── Story (User-facing functionality, fits in a sprint)
│
└── Task (Technical work, fits in a sprint)
CRITICAL: Different relationships use different Jira fields. Using the wrong field will cause creation to fail.
| Relationship | Field | MCP Parameter | Value Format |
|---|---|---|---|
| Epic → Feature | Parent Link (custom field) | additional_fields.customfield_12313140 | "PROJ-123" (string) |
| Story → Epic | Epic Link (custom field) | additional_fields.customfield_12311140 | "PROJ-123" (string) |
| Task → Epic | Epic Link (custom field) | additional_fields.customfield_12311140 | "PROJ-123" (string) |
| Task → Story | Epic Link (custom field) | additional_fields.customfield_12311140 | "PROJ-123" (string) |
Why the difference?
customfield_12313140) is used for Epic→Feature relationships in CNTRLPLANEcustomfield_12311140) is used for Story/Task→Epic relationshipsparent field does NOT work for these relationshipsmcp__atlassian__jira_create_issue(
project_key="CNTRLPLANE",
summary="Add metrics endpoint for cluster health",
issue_type="Story",
description="<story description>",
components="HyperShift / ROSA",
additional_fields={
"customfield_12311140": "CNTRLPLANE-456", # Epic Link - links to parent epic
"labels": ["ai-generated-jira"],
"security": {"name": "Red Hat Employee"}
}
)
mcp__atlassian__jira_create_issue(
project_key="CNTRLPLANE",
summary="Multi-cluster metrics aggregation",
issue_type="Epic",
description="<epic description>",
components="HyperShift",
additional_fields={
"customfield_12311141": "Multi-cluster metrics aggregation", # Epic Name (same as summary)
"customfield_12313140": "CNTRLPLANE-100", # Parent Link - links to parent feature (STRING, not object!)
"labels": ["ai-generated-jira"],
"security": {"name": "Red Hat Employee"}
}
)
mcp__atlassian__jira_create_issue(
project_key="CNTRLPLANE",
summary="Refactor metrics collection pipeline",
issue_type="Task",
description="<task description>",
additional_fields={
"customfield_12311140": "CNTRLPLANE-456", # Epic Link - links to parent epic
"labels": ["ai-generated-jira"],
"security": {"name": "Red Hat Employee"}
}
)
When the --parent flag is provided, follow this strategy:
Before creating the issue, validate the parent:
# Fetch parent issue to verify it exists and is correct type
parent_issue = mcp__atlassian__jira_get_issue(issue_key="<parent-key>")
# Verify parent type matches expected hierarchy:
# - If creating Story/Task with --parent, parent should be Epic
# - If creating Epic with --parent, parent should be Feature
Validation rules:
| Creating | Parent Should Be | If Wrong Type |
|---|---|---|
| Story | Epic | Warn user, ask to confirm or correct |
| Task | Epic or Story | Warn user, ask to confirm or correct |
| Epic | Feature | Warn user, ask to confirm or correct |
If parent not found:
Parent issue CNTRLPLANE-999 not found.
Options:
1. Proceed without parent link
2. Specify different parent
3. Cancel creation
What would you like to do?
Include the appropriate parent field based on issue type:
customfield_12311140 (Epic Link)customfield_12313140 (Parent Link)If creation fails with an error related to parent linking:
Detect linking error: Error message contains "epic", "parent", "link", or "customfield"
Create without parent link:
issue = mcp__atlassian__jira_create_issue(
# ... same parameters but WITHOUT the parent/epic link field
)
Link via update:
# For Story/Task → Epic:
mcp__atlassian__jira_update_issue(
issue_key=issue["key"],
fields={},
additional_fields={"customfield_12311140": "<epic-key>"}
)
# For Epic → Feature:
mcp__atlassian__jira_update_issue(
issue_key=issue["key"],
fields={},
additional_fields={"customfield_12313140": "<feature-key>"}
)
Report outcome:
Created: CNTRLPLANE-789
Linked to parent: CNTRLPLANE-456 ✓
Title: <issue title>
URL: https://issues.redhat.com/browse/CNTRLPLANE-789
If the update to add parent link also fails:
Created: CNTRLPLANE-789
⚠️ Automatic parent linking failed. Please link manually in Jira.
URL: https://issues.redhat.com/browse/CNTRLPLANE-789
| Error Message | Cause | Solution |
|---|---|---|
Field 'parent' does not exist | Using standard parent field | Use customfield_12313140 (Parent Link) or customfield_12311140 (Epic Link) |
customfield_12311140 is not valid | Epic Link field issue | Use fallback: create then update |
customfield_12313140 is not valid | Parent Link field issue | Use fallback: create then update |
Parent issue not found | Invalid parent key | Verify parent exists first |
Cannot link to issue of type X | Wrong parent type | Verify hierarchy (Story→Epic, Epic→Feature) |
The jira:create command runs in multiple phases:
Invoke the appropriate skill based on issue type using the Skill tool:
Type: story → Invoke jira:create-story skill
Type: epic → Invoke jira:create-epic skill
Type: feature → Invoke jira:create-feature skill
Type: task → Invoke jira:create-task skill
Type: bug → Invoke jira:create-bug skill
Type: feature-request → Invoke jira:create-feature-request skill
Invoke project-specific and team-specific skills using the Skill tool as needed:
Project-specific skills:
cntrlplane skill for CNTRLPLANE stories/epics/features/tasksocpbugs skill for OCPBUGS bugsTeam-specific skills:
hypershift skillGeneral projects use only the type-specific skills (create-story, create-bug, etc.) for best practices.
Parse command arguments:
type, summaryproject_key (may have project-specific defaults)--component, --version, --parentAnalyze summary text for context clues:
Universal requirements (MUST be applied to ALL tickets):
Project defaults:
Team defaults:
General projects:
Prompt for missing required information based on issue type:
For Stories:
For Epics:
--parent or prompt)For Features:
For Tasks:
For Bugs:
For Feature Requests:
Before security validation, validate the summary format to catch common mistakes:
Check for anti-patterns:
Action if anti-pattern detected:
Detect that user put full user story in summary field
Extract the key action/feature from the summary
Generate a concise alternative (5-10 words)
Prompt user for confirmation:
The summary looks like a full user story. Summaries should be concise titles.
Current: "As a cluster admin, I want to configure ImageTagMirrorSet in HostedCluster CRs so that I can enable tag-based image proxying"
Suggested: "Enable ImageTagMirrorSet configuration in HostedCluster CRs"
Use the suggested summary? (yes/no/edit)
If user says yes, use suggested summary
If user says edit, prompt for their preferred summary
If user says no, use their original summary (but warn it may be truncated in Jira)
Note: This validation should happen BEFORE creating the issue, to avoid having to update the summary afterward.
Scan all content (summary, description, comments) for sensitive data:
Prohibited content:
https://user:pass@example.com)Action if detected:
Use the mcp__atlassian__jira_create_issue MCP tool with collected parameters.
Build additional_fields:
Required fields (MUST be included):
security: {"name": "Red Hat Employee"}labels: ["ai-generated-jira"] (may be combined with additional labels)Project-specific and team-specific fields:
The MCP tool parameters come from the combined guidance of type-specific, project-specific, and team-specific skills, with universal requirements always applied.
Note: Project-specific skills (e.g., CNTRLPLANE) may implement fallback strategies for handling creation failures (such as epic linking). Refer to the project-specific skill documentation for these strategies.
Display to user:
Example output:
Created: PROJECT-1234
Title: <issue summary>
URL: <issue URL>
Applied defaults:
- <Field>: <Value>
- <Field>: <Value>
(varies by project/team)
Create a story with minimal info:
/jira:create story MYPROJECT "Add user dashboard"
→ Prompts for user story format, acceptance criteria, and any required fields
Create a story with options:
/jira:create story MYPROJECT "Add search functionality" --component "Frontend" --version "2.5.0"
→ Uses provided component and version, prompts only for description and AC
Create an epic with parent feature:
/jira:create epic MYPROJECT "Mobile application redesign" --parent MYPROJECT-100
→ Links epic to parent feature, prompts for epic details
Create a bug:
/jira:create bug MYPROJECT "Login button doesn't work on mobile"
→ Prompts for bug template fields (description, steps, actual/expected results)
Create a bug with component:
/jira:create bug MYPROJECT "API returns 500 error" --component "Backend"
→ Uses specified component, prompts for bug details
Create a task under a story:
/jira:create task MYPROJECT "Update API documentation" --parent MYPROJECT-456
→ Links task to parent story, prompts for task description
Create a feature:
/jira:create feature MYPROJECT "Advanced search capabilities"
→ Prompts for market problem, strategic value, success criteria, epic breakdown
Create a feature request:
/jira:create feature-request RFE "Support custom SSL certificates for ROSA HCP"
→ Prompts for nature/description, business requirements, affected components (4-question workflow)
Create with project-specific conventions (examples vary by project):
/jira:create story SPECIALPROJECT "New capability"
→ Applies SPECIALPROJECT-specific skills and conventions automatically
$1 – type (required)
Issue type to create.
Options: story | epic | feature | task | bug | feature-request
$2 – project-key (optional for bugs and feature-requests)
JIRA project key (e.g., CNTRLPLANE, OCPBUGS, RFE, MYPROJECT).
Default for bugs: OCPBUGS
Default for feature-requests: RFE
Required for: stories, epics, features, tasks
$3 – summary (required)
Issue title/summary text.
Use quotes for multi-word summaries: "Enable automatic scaling"
--component (optional)
Component name (e.g., "HyperShift / ROSA", "Networking", "API").
Auto-detected from summary context if not provided (for CNTRLPLANE/OCPBUGS).
--version (optional)
Target version. User input is normalized to Jira format openshift-X.Y.
Accepted input formats (examples):
| User Input | Normalized |
|---|---|
4.21 | openshift-4.21 |
4.22.0 | openshift-4.22 |
openshift 4.23 | openshift-4.23 |
OCP 4.21 | openshift-4.21 |
ocp 4.22 | openshift-4.22 |
Behavior: If not provided via flag, user is prompted (optional field).
Normalization rules:
--parent (optional)
Parent issue key for linking (e.g., CNTRLPLANE-123).
Valid for:
CNTRLPLANE-1234)The command automatically detects and applies project-specific conventions:
cntrlplane skill for CNTRLPLANE stories/epics/features/tasksocpbugs skill for OCPBUGS bugsTo add conventions for your project, create a skill at:
plugins/jira/skills/your-project-name/SKILL.md
Then update the command implementation to invoke your skill when the project is detected.
The command respects MCP Jira server configuration:
Scenario: User specifies invalid type.
Action:
Invalid issue type "stroy". Valid types: story, epic, feature, task, bug
Did you mean "story"?
Scenario: Project key required but not provided.
Action:
Project key is required for stories/tasks/epics/features.
Usage: /jira:create story PROJECT-KEY "summary"
Example: /jira:create story CNTRLPLANE "Enable autoscaling"
Scenario: Project requires component, cannot auto-detect, user didn't specify.
Action:
Component is required for CNTRLPLANE issues. Which component?
1. HyperShift / ARO - for ARO HCP (Azure) issues
2. HyperShift / ROSA - for ROSA HCP (AWS) issues
3. HyperShift - for platform-agnostic issues
Select a component (1-3):
Scenario: User specifies --parent but issue doesn't exist.
Action:
Parent issue CNTRLPLANE-999 not found.
Options:
1. Proceed without parent link
2. Specify different parent
3. Cancel creation
What would you like to do?
Scenario: Credentials or secrets detected.
Action:
I detected what appears to be an API token in the description.
Please review and redact before proceeding. Use placeholder values like:
- YOUR_API_KEY
- <redacted>
- ********
Would you like to edit the description?
Scenario: MCP tool returns an error.
Action:
Common errors:
Scenario: Story/task creation fails when including epic link field.
Action: Refer to project-specific skills for epic linking fallback strategies:
General pattern:
Scenario: Field provided in wrong format (e.g., Target Version as string instead of array).
Common field format errors:
Target Version format
"customfield_12319940": "openshift-4.21""customfield_12319940": [{"id": "12448830"}]mcp__atlassian__jira_get_project_versions, convert to correct formatEpic Link format
"parent": {"key": "EPIC-123"} (for stories)"customfield_12311140": "EPIC-123" (string, not object)Component format
"components": "ComponentName""components": ["ComponentName"] (array) or just "ComponentName" (MCP accepts both)Detection:
--component and --version to skip prompts--parent to maintain hierarchy❌ Wrong issue type
/jira:create story MYPROJECT "Refactor database layer"
✅ This is technical work, use task instead
❌ Vague summaries
/jira:create bug "Something is broken"
✅ Be specific: "API server returns 500 error when creating namespaces"
❌ Missing context
/jira:create epic MYPROJECT "Improve things"
✅ Be descriptive: "Mobile application redesign"
❌ Including credentials
Steps to reproduce:
1. Export API_KEY=sk_live_abc123xyz
✅ Use placeholders: "Export API_KEY=YOUR_API_KEY"
jira:solve - Analyze and solve Jira issuesjira:grooming - Generate grooming meeting agendasjira:status-rollup - Create status rollup reportsjira:generate-test-plan - Generate test plans for PRsThe following skills are automatically invoked by this command:
Type-specific skills:
Project-specific skills:
Team-specific skills:
To view skill details:
ls plugins/jira/skills/
cat plugins/jira/skills/create-story/SKILL.md
cat plugins/jira/skills/create-feature-request/SKILL.md
cat plugins/jira/skills/cntrlplane/SKILL.md
cat plugins/jira/skills/ocpbugs/SKILL.md
cat plugins/jira/skills/hypershift/SKILL.md