5.0 KiB
Create Story — Jira Output
The workflow execution engine is governed by: {project-root}/_bmad/core/tasks/workflow.xml You MUST have already loaded and processed: the workflow-jira.yaml for this workflow
Overview
Prepares a story with full development context. The analysis steps follow the standard bmm create-story checklist. The output step writes to Jira (updating the Story issue description and adding dev notes as a comment) and transitions the story to "Ready for Dev".
Ask the user which story to prepare, or present the next unprepared story from the backlog Invoke `read-jira-context` task with `context_type: "sprint_status"` to find stories in Backlog status Call `Search Issues` with JQL: `project = {jira_project_key} AND issuetype = Story AND status = Backlog ORDER BY rank ASC` and `limit: 5`
Present candidates to the user:
| # | Key | Story | Epic |
|---|---|---|---|
| 1 | PROJ-12 | Story 1.1: User Authentication | Epic 1 |
| 2 | PROJ-13 | Story 1.2: Account Management | Epic 1 |
Wait for user selection
Call Get Issue with the selected issue_key and fields: "summary,description,labels" to load full story details
Invoke read-jira-context task with context_type: "previous_story_learnings" to fetch:
- Completion notes from the last 3 done stories (for incorporating learnings)
Read the project context file if it exists: {project_context}
- Validate the story has clear acceptance criteria
- Identify relevant architecture patterns and constraints
- Map tasks to the project's source tree
- Determine testing strategy and standards
- Check for dependencies on other stories
- Identify files and modules that will be touched
Build the enriched story content using the bmm story template at {bmm_template} as the structure guide
The enriched content includes:
- User Story (from Jira issue description)
- Acceptance Criteria (from Jira, validated for completeness)
- Tasks / Subtasks (decomposed from AC, ordered for implementation)
- Dev Notes (architecture patterns, source tree components, testing standards)
- Project Structure Notes (alignment with project conventions)
- References (source paths, relevant documentation sections)
issue_key: "{selected_issue_key}"
fields:
description: |
{enriched_story_description_in_markdown}
additional_fields:
labels: ["{existing_labels}", "{agent_label_prefix}sm"]
Call Add Comment to post the dev notes separately (keeps them visible in the comment stream):
issue_key: "{selected_issue_key}"
body: |
## Dev Notes — Prepared by SM Agent
### Architecture Context
{architecture_patterns_and_constraints}
### Source Tree Components
{files_and_modules_to_touch}
### Testing Standards
{testing_approach}
### References
{cited_sources_with_paths}
For each Task/Subtask identified in step 3:
Call `Create Issue`:
project_key: "{jira_project_key}"
issue_type: "Sub-task"
summary: "{task_description} (AC: #{ac_number})"
description: "{task_details}"
additional_fields:
parent:
key: "{selected_issue_key}"
labels: ["{agent_label_prefix}sm", "bmad-task"]
Invoke `transition-jira-issue` task with:
issue_key: "{selected_issue_key}"
transition_id: "{status_transitions.story.backlog_to_ready_for_dev}"
comment: "Story prepared with full dev context by SM agent"
fallback_status_name: "Ready for Dev"
If `{output_mode}` is `"dual"`:
Also write the enriched story to local file: `{implementation_artifacts}/{story-key}.md`
Report to user:
Story Prepared: {story_title}
- Jira Issue: {selected_issue_key}
- Status: Ready for Dev
- Tasks Created: {task_count} subtasks
- Dev Notes: Posted as comment on {selected_issue_key}
Next Steps:
- Dev agent can pick up this story with [DS] Dev Story
- Or prepare the next story with [CS] Create Story