siesa-agents 2.1.28 → 2.1.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -2
- package/bin/install.js +9 -5
- package/bmad-core/agents/dev.md +3 -0
- package/bmad-core/agents/pm.md +19 -0
- package/bmad-core/agents/po.md +22 -0
- package/bmad-core/data/jira-preferences.md +153 -0
- package/bmad-core/tasks/create-next-story.md +31 -0
- package/bmad-core/tasks/jira-setup.md +396 -0
- package/bmad-core/tasks/sync-epic-files-to-jira.md +513 -0
- package/bmad-core/tasks/sync-prd-to-jira.md +439 -0
- package/bmad-core/tasks/sync-stories-batch-to-jira.md +561 -0
- package/bmad-core/tasks/sync-story-to-jira.md +628 -0
- package/bmad-core/tasks/update-epic-stories-jira-status.md +799 -0
- package/bmad-core/tasks/update-story-jira-status.md +600 -0
- package/bmad-core/tasks/validate-jira-auth.md +251 -0
- package/bmad-core/templates/jira-conf-tmpl.md +13 -0
- package/claude/commands/BMad/agents/dev.md +3 -0
- package/claude/commands/BMad/agents/pm.md +6 -0
- package/claude/commands/BMad/agents/po.md +21 -0
- package/claude/settings.local.json +4 -0
- package/github/chatmodes/dev.chatmode.md +3 -0
- package/github/chatmodes/pm.chatmode.md +6 -0
- package/github/chatmodes/po.chatmode.md +17 -1
- package/package.json +1 -1
- package/vscode/mcp.json +4 -0
|
@@ -0,0 +1,628 @@
|
|
|
1
|
+
<!-- Powered by BMAD™ Core -->
|
|
2
|
+
|
|
3
|
+
# Sync Story Tasks to Jira Task
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
Automatically create Jira subtasks based on an approved user story. This task extracts the tasks structure from a story document and creates corresponding **Subtasks directly under the Story** in Jira using the MCP Jira integration. The original subtasks from the story document are included in each Subtask's description.
|
|
8
|
+
|
|
9
|
+
## Jira Hierarchy Constraint
|
|
10
|
+
|
|
11
|
+
**CRITICAL:** Jira Software projects use a fixed hierarchy:
|
|
12
|
+
```
|
|
13
|
+
Epic (level 1)
|
|
14
|
+
└── Story (level 0)
|
|
15
|
+
└── Subtask (level -1)
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
- **Stories and Tasks are at the SAME hierarchy level** - Tasks CANNOT be children of Stories
|
|
19
|
+
- **Only Subtasks can be children of Stories**
|
|
20
|
+
- Therefore, this task creates **story tasks as Jira Subtasks** under the parent Story
|
|
21
|
+
- The original subtasks from the story document are embedded in the Subtask's description
|
|
22
|
+
|
|
23
|
+
## When to Use This Task
|
|
24
|
+
|
|
25
|
+
**Use this task when:**
|
|
26
|
+
|
|
27
|
+
- You have an approved story (Status: "Approved") ready for implementation
|
|
28
|
+
- The story has complete tasks and subtasks defined
|
|
29
|
+
- You need to track implementation progress in Jira
|
|
30
|
+
- You want to maintain traceability between story documents and Jira issues
|
|
31
|
+
|
|
32
|
+
**Prerequisites:**
|
|
33
|
+
|
|
34
|
+
- Story document with Status: "Approved" (NOT "Draft", "InProgress", "Review", or "Done")
|
|
35
|
+
- Complete tasks and subtasks defined in the story
|
|
36
|
+
- Jira preferences configured in `.bmad-core/data/jira-preferences.md`
|
|
37
|
+
- Project-specific Jira configuration in `docs/jira-conf.md`
|
|
38
|
+
- Active Jira connection with appropriate permissions
|
|
39
|
+
- MCP Jira integration available
|
|
40
|
+
- Parent story must already exist in Jira (or be created first)
|
|
41
|
+
|
|
42
|
+
## Instructions
|
|
43
|
+
|
|
44
|
+
### Phase 1: Configuration & Validation
|
|
45
|
+
|
|
46
|
+
#### Step 0: Validate Jira Authentication (REQUIRED)
|
|
47
|
+
|
|
48
|
+
**CRITICAL:** Validate authentication BEFORE any Jira operations
|
|
49
|
+
|
|
50
|
+
**Action:** Execute authentication check
|
|
51
|
+
|
|
52
|
+
- [ ] Call `validate-jira-auth.md` task
|
|
53
|
+
- [ ] Verify authentication is active
|
|
54
|
+
- [ ] Only proceed if validation passes
|
|
55
|
+
|
|
56
|
+
**If validation fails:** HALT and instruct user to re-authenticate via MCP panel before continuing.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
#### Step 1: Load Jira Configuration
|
|
61
|
+
|
|
62
|
+
```elicit
|
|
63
|
+
path: Load Jira configuration files
|
|
64
|
+
format: |
|
|
65
|
+
Loading Jira configuration from:
|
|
66
|
+
- `.bmad-core/data/jira-preferences.md` (global preferences)
|
|
67
|
+
- `docs/jira-conf.md` (project-specific settings)
|
|
68
|
+
|
|
69
|
+
Please confirm the following settings:
|
|
70
|
+
- Provider: {{provider}}
|
|
71
|
+
- Project Key: {{project_key}}
|
|
72
|
+
- Project Name: {{project_name}}
|
|
73
|
+
- Cloud ID: {{cloud_id}}
|
|
74
|
+
|
|
75
|
+
Type 'proceed' to continue, or 'setup' to run jira-setup first.
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**Action:** Verify configuration files exist and are complete
|
|
79
|
+
|
|
80
|
+
- [ ] `.bmad-core/data/jira-preferences.md` exists
|
|
81
|
+
- [ ] `docs/jira-conf.md` exists with all required fields
|
|
82
|
+
- [ ] Subtask issue type ID available (typically `10318` or as configured)
|
|
83
|
+
|
|
84
|
+
**If Configuration Missing:**
|
|
85
|
+
```output
|
|
86
|
+
⚠️ Jira configuration incomplete. Please run the `*jira-setup` command first to configure project-specific Jira integration.
|
|
87
|
+
|
|
88
|
+
Required files:
|
|
89
|
+
- `docs/jira-conf.md` - Project-specific settings (Project Key, Cloud ID, etc.)
|
|
90
|
+
- `.bmad-core/data/jira-preferences.md` - Global preferences
|
|
91
|
+
|
|
92
|
+
HALT execution until configuration is complete.
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
#### Step 2: Identify Story Document
|
|
96
|
+
|
|
97
|
+
```elicit
|
|
98
|
+
path: Locate the story to sync
|
|
99
|
+
format: |
|
|
100
|
+
Which story document should have its tasks synced to Jira?
|
|
101
|
+
|
|
102
|
+
Options:
|
|
103
|
+
1. Specify file path (e.g., `docs/stories/1.1.user-authentication.story.md`)
|
|
104
|
+
2. Search for story by name
|
|
105
|
+
3. Use story from current epic context
|
|
106
|
+
|
|
107
|
+
Enter selection (1-3) or file path:
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
#### Step 3: Validate Story Approval Status
|
|
111
|
+
|
|
112
|
+
**Action:** Read story document and validate it's ready for Jira sync
|
|
113
|
+
|
|
114
|
+
- [ ] Load story document content
|
|
115
|
+
- [ ] Check Status field
|
|
116
|
+
- [ ] Verify Status is "Approved" (not "Draft", "InProgress", "Review", or "Done")
|
|
117
|
+
- [ ] Confirm Tasks/Subtasks section exists and is populated
|
|
118
|
+
- [ ] Validate story structure is complete
|
|
119
|
+
|
|
120
|
+
**Expected Output:**
|
|
121
|
+
```markdown
|
|
122
|
+
## Story Validation Results:
|
|
123
|
+
|
|
124
|
+
- **Story Title:** {{story_title}}
|
|
125
|
+
- **Status:** {{status}}
|
|
126
|
+
- **Epic:** {{epic_reference}}
|
|
127
|
+
- **Tasks Count:** {{task_count}}
|
|
128
|
+
- **Subtasks Count:** {{subtask_count}}
|
|
129
|
+
|
|
130
|
+
✓ Story status: Approved
|
|
131
|
+
✓ Tasks/Subtasks section found
|
|
132
|
+
✓ Ready for Jira synchronization
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
**If Status is NOT "Approved":**
|
|
136
|
+
```output
|
|
137
|
+
❌ STORY NOT APPROVED FOR IMPLEMENTATION
|
|
138
|
+
|
|
139
|
+
Current Status: {{status}}
|
|
140
|
+
|
|
141
|
+
This story cannot be synced to Jira because it is not approved.
|
|
142
|
+
|
|
143
|
+
Valid statuses for sync:
|
|
144
|
+
- "Approved" - Ready for implementation ✓
|
|
145
|
+
|
|
146
|
+
Invalid statuses:
|
|
147
|
+
- "Draft" - Story still being drafted
|
|
148
|
+
- "InProgress" - Already being implemented (sync not needed)
|
|
149
|
+
- "Review" - Under review (needs approval first)
|
|
150
|
+
- "Done" - Already completed (sync not applicable)
|
|
151
|
+
|
|
152
|
+
Please ensure:
|
|
153
|
+
1. Story has been validated using `*validate-story-draft` command
|
|
154
|
+
2. Product Owner has approved the story
|
|
155
|
+
3. Story Status field is set to "Approved"
|
|
156
|
+
|
|
157
|
+
HALT execution until story is approved.
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
#### Step 3.5: Check for Previous Synchronization
|
|
161
|
+
|
|
162
|
+
**CRITICAL:** Detect if story was already synced to prevent duplicate subtasks
|
|
163
|
+
|
|
164
|
+
**Action:** Check story document for existing Jira synchronization
|
|
165
|
+
|
|
166
|
+
- [ ] Search for "## Jira Synchronization" section in story document
|
|
167
|
+
- [ ] Search for inline Jira keys pattern `[XX-###]` in Tasks section
|
|
168
|
+
- [ ] Determine if story was previously synced
|
|
169
|
+
|
|
170
|
+
**Detection Methods:**
|
|
171
|
+
|
|
172
|
+
1. **Section Detection:** Look for `## Jira Synchronization` heading
|
|
173
|
+
2. **Inline Keys Detection:** Look for pattern `\[([A-Z]+-\d+)\]` in task lines
|
|
174
|
+
|
|
175
|
+
**If Previously Synced - Present Options:**
|
|
176
|
+
|
|
177
|
+
```elicit
|
|
178
|
+
path: Story already synchronized
|
|
179
|
+
format: |
|
|
180
|
+
⚠️ STORY ALREADY SYNCHRONIZED TO JIRA
|
|
181
|
+
|
|
182
|
+
This story appears to have been previously synced:
|
|
183
|
+
|
|
184
|
+
**Evidence Found:**
|
|
185
|
+
{{detection_evidence}}
|
|
186
|
+
|
|
187
|
+
**Existing Jira References:**
|
|
188
|
+
{{for each found_key}}
|
|
189
|
+
- {{jira_key}}: {{task_description}}
|
|
190
|
+
{{end for}}
|
|
191
|
+
|
|
192
|
+
**Options:**
|
|
193
|
+
1. Skip - Do not sync this story (recommended)
|
|
194
|
+
2. Force Re-sync - Create NEW subtasks (will create duplicates!)
|
|
195
|
+
3. Cancel - Abort operation
|
|
196
|
+
|
|
197
|
+
⚠️ WARNING: Option 2 will create DUPLICATE subtasks in Jira.
|
|
198
|
+
Only use if previous subtasks were deleted or you intentionally want duplicates.
|
|
199
|
+
|
|
200
|
+
Enter selection (1-3):
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
**Behavior Based on Selection:**
|
|
204
|
+
|
|
205
|
+
- **Option 1 (Skip):**
|
|
206
|
+
```output
|
|
207
|
+
⊘ Skipping story: {{story_title}}
|
|
208
|
+
Reason: Already synchronized to Jira
|
|
209
|
+
Existing subtasks preserved.
|
|
210
|
+
```
|
|
211
|
+
HALT execution for this story.
|
|
212
|
+
|
|
213
|
+
- **Option 2 (Force Re-sync):**
|
|
214
|
+
```output
|
|
215
|
+
⚠️ Force re-sync selected.
|
|
216
|
+
WARNING: This will create duplicate subtasks in Jira.
|
|
217
|
+
Proceeding with synchronization...
|
|
218
|
+
```
|
|
219
|
+
Continue to Step 4.
|
|
220
|
+
|
|
221
|
+
- **Option 3 (Cancel):**
|
|
222
|
+
```output
|
|
223
|
+
❌ Operation cancelled by user.
|
|
224
|
+
```
|
|
225
|
+
HALT execution.
|
|
226
|
+
|
|
227
|
+
**If NOT Previously Synced:**
|
|
228
|
+
```output
|
|
229
|
+
✓ No previous synchronization detected
|
|
230
|
+
✓ Story is ready for first-time sync
|
|
231
|
+
```
|
|
232
|
+
Continue to Step 4.
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
#### Step 4: Parse Story Tasks Structure
|
|
237
|
+
|
|
238
|
+
**Action:** Extract tasks and subtasks from story document
|
|
239
|
+
|
|
240
|
+
- [ ] Parse Tasks / Subtasks section
|
|
241
|
+
- [ ] Identify parent tasks (top-level checkboxes)
|
|
242
|
+
- [ ] Identify subtasks (nested checkboxes under each task)
|
|
243
|
+
- [ ] Extract task descriptions and any AC references
|
|
244
|
+
- [ ] Build hierarchical structure
|
|
245
|
+
- [ ] Validate all tasks are properly formatted
|
|
246
|
+
|
|
247
|
+
**Expected Output:**
|
|
248
|
+
```markdown
|
|
249
|
+
## Parsed Tasks Structure:
|
|
250
|
+
|
|
251
|
+
### Task 1: {{Task 1 Description}} (AC: {{ac_refs}})
|
|
252
|
+
- Subtask 1.1: {{Subtask Description}}
|
|
253
|
+
- Subtask 1.2: {{Subtask Description}}
|
|
254
|
+
|
|
255
|
+
### Task 2: {{Task 2 Description}} (AC: {{ac_refs}})
|
|
256
|
+
- Subtask 2.1: {{Subtask Description}}
|
|
257
|
+
- Subtask 2.2: {{Subtask Description}}
|
|
258
|
+
|
|
259
|
+
### Task 3: {{Task 3 Description}} (AC: {{ac_refs}})
|
|
260
|
+
- Subtask 3.1: {{Subtask Description}}
|
|
261
|
+
|
|
262
|
+
**Summary:**
|
|
263
|
+
- Total Tasks: {{task_count}}
|
|
264
|
+
- Total Subtasks in descriptions: {{subtask_count}}
|
|
265
|
+
- Total Jira Subtasks to Create: {{task_count}}
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
#### Step 5: Check for Existing Jira Story and Get Authenticated User
|
|
269
|
+
|
|
270
|
+
```elicit
|
|
271
|
+
path: Verify parent story exists in Jira
|
|
272
|
+
format: |
|
|
273
|
+
Does this story already exist in Jira?
|
|
274
|
+
|
|
275
|
+
Options:
|
|
276
|
+
1. Yes, I have the Jira Story Key (e.g., PM-123)
|
|
277
|
+
2. No, create the parent story first
|
|
278
|
+
3. Search for story in Jira by title
|
|
279
|
+
|
|
280
|
+
Enter selection (1-3) or Jira Story Key:
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
**Action:** Validate parent story and get authenticated user
|
|
284
|
+
|
|
285
|
+
- [ ] If story key provided, verify it exists in Jira
|
|
286
|
+
- [ ] If story doesn't exist, offer to create it first
|
|
287
|
+
- [ ] Retrieve story key for linking subtasks
|
|
288
|
+
- [ ] **Get authenticated user using `atlassianUserInfo` MCP tool**
|
|
289
|
+
- [ ] Store parent story key and user account ID
|
|
290
|
+
|
|
291
|
+
**Expected Output:**
|
|
292
|
+
```markdown
|
|
293
|
+
✓ Parent Story Verified: {{story_key}} - {{story_title}}
|
|
294
|
+
✓ Authenticated User: {{user_display_name}} ({{user_account_id}})
|
|
295
|
+
|
|
296
|
+
All tasks will be created as Subtasks of this story.
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
#### Step 6: Assign Story to Authenticated User
|
|
300
|
+
|
|
301
|
+
**Action:** Assign the parent story to the authenticated user
|
|
302
|
+
|
|
303
|
+
```action
|
|
304
|
+
Using MCP Jira Integration:
|
|
305
|
+
1. Call `atlassianUserInfo` to get current authenticated user's account_id
|
|
306
|
+
2. Call `editJiraIssue` to update the story ({{story_key}}) with:
|
|
307
|
+
- assignee: { accountId: "{{user_account_id}}" }
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
**Expected Output:**
|
|
311
|
+
```output
|
|
312
|
+
✅ Story {{story_key}} assigned to {{user_display_name}}
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
#### Step 7: Confirm Sync Plan
|
|
316
|
+
|
|
317
|
+
```elicit
|
|
318
|
+
path: Review and confirm subtask creation plan
|
|
319
|
+
format: |
|
|
320
|
+
The following Subtasks will be created in Jira ({{project_key}}):
|
|
321
|
+
|
|
322
|
+
**Parent Story:** {{story_key}} - {{story_title}}
|
|
323
|
+
**Assigned To:** {{user_display_name}}
|
|
324
|
+
|
|
325
|
+
**Subtasks to Create (from story tasks):**
|
|
326
|
+
{{Display parsed tasks - each task becomes a Subtask with its subtasks in description}}
|
|
327
|
+
|
|
328
|
+
**Jira Configuration:**
|
|
329
|
+
- Issue Type: Subtarea ({{subtask_issue_type_id}})
|
|
330
|
+
- Default Priority: {{default_priority}}
|
|
331
|
+
- Parent Story: {{story_key}}
|
|
332
|
+
- Assignee: {{user_display_name}}
|
|
333
|
+
|
|
334
|
+
**Total Subtasks to Create:** {{task_count}}
|
|
335
|
+
|
|
336
|
+
**Note:** Each story task becomes a Jira Subtask. The original subtasks
|
|
337
|
+
from the story document will be included in each Subtask's description
|
|
338
|
+
as a checklist.
|
|
339
|
+
|
|
340
|
+
Options:
|
|
341
|
+
1. Proceed with creation
|
|
342
|
+
2. Enable dry-run mode (preview only, don't create)
|
|
343
|
+
3. Modify default priority
|
|
344
|
+
4. Cancel
|
|
345
|
+
|
|
346
|
+
Enter selection (1-4):
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
### Phase 2: Jira Subtask Creation
|
|
350
|
+
|
|
351
|
+
#### Step 8: Create Subtasks (from Story Tasks)
|
|
352
|
+
|
|
353
|
+
**For Each Task in the Story Document:**
|
|
354
|
+
|
|
355
|
+
```action
|
|
356
|
+
Using MCP Jira Integration:
|
|
357
|
+
1. Create Subtask issue with:
|
|
358
|
+
- Issue Type: Subtarea ({{subtask_issue_type_id}})
|
|
359
|
+
- Project: {{project_key}}
|
|
360
|
+
- Summary: {{task_description}}
|
|
361
|
+
- Description: |
|
|
362
|
+
**Story:** [{{story_key}}]({{jira_url}}/browse/{{story_key}})
|
|
363
|
+
**Acceptance Criteria References:** {{ac_references}}
|
|
364
|
+
|
|
365
|
+
---
|
|
366
|
+
|
|
367
|
+
## Checklist (Subtasks from Story)
|
|
368
|
+
|
|
369
|
+
{{for each subtask in task.subtasks}}
|
|
370
|
+
- [ ] {{subtask_description}}
|
|
371
|
+
{{end for}}
|
|
372
|
+
|
|
373
|
+
---
|
|
374
|
+
|
|
375
|
+
**Implementation Notes:**
|
|
376
|
+
{{relevant_dev_notes}}
|
|
377
|
+
|
|
378
|
+
---
|
|
379
|
+
*Source: {{story_file_path}}*
|
|
380
|
+
*Synchronized by PO Agent - sync-story-to-jira task*
|
|
381
|
+
- Parent: {{story_key}}
|
|
382
|
+
- Priority: {{default_priority}}
|
|
383
|
+
- Assignee: {{user_account_id}} (authenticated Jira user)
|
|
384
|
+
|
|
385
|
+
2. Store created subtask key (e.g., PM-456)
|
|
386
|
+
3. Record task mapping: Task {{task_number}} → {{jira_subtask_key}}
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
**Progress Tracking:**
|
|
390
|
+
```output
|
|
391
|
+
Creating Subtasks under Story {{story_key}}...
|
|
392
|
+
|
|
393
|
+
✓ Task 1: {{task_1_description}} → {{subtask_1_key}} ({{subtask_count_1}} items in checklist)
|
|
394
|
+
✓ Task 2: {{task_2_description}} → {{subtask_2_key}} ({{subtask_count_2}} items in checklist)
|
|
395
|
+
✓ Task 3: {{task_3_description}} → {{subtask_3_key}} ({{subtask_count_3}} items in checklist)
|
|
396
|
+
|
|
397
|
+
Subtasks Created: {{created_count}}/{{total_task_count}}
|
|
398
|
+
All subtasks assigned to: {{user_display_name}}
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
### Phase 3: Verification & Documentation
|
|
402
|
+
|
|
403
|
+
#### Step 9: Verify All Issues Created
|
|
404
|
+
|
|
405
|
+
**Action:** Validate all subtasks were created successfully
|
|
406
|
+
|
|
407
|
+
- [ ] Count created subtasks matches expected task count
|
|
408
|
+
- [ ] All subtasks are children of the parent story
|
|
409
|
+
- [ ] All subtasks have the checklist in description
|
|
410
|
+
- [ ] All subtasks assigned to authenticated user
|
|
411
|
+
- [ ] No creation errors or warnings
|
|
412
|
+
|
|
413
|
+
**Expected Output:**
|
|
414
|
+
```markdown
|
|
415
|
+
## Creation Summary:
|
|
416
|
+
|
|
417
|
+
✓ All Subtasks Created Successfully
|
|
418
|
+
|
|
419
|
+
**Parent Story:** {{story_key}} - {{story_title}}
|
|
420
|
+
**Assigned To:** {{user_display_name}}
|
|
421
|
+
|
|
422
|
+
**Subtasks:**
|
|
423
|
+
| # | Task Description | Jira Key | Checklist Items |
|
|
424
|
+
|---|------------------|----------|-----------------|
|
|
425
|
+
| 1 | {{task_1_description}} | {{subtask_1_key}} | {{subtask_count_1}} |
|
|
426
|
+
| 2 | {{task_2_description}} | {{subtask_2_key}} | {{subtask_count_2}} |
|
|
427
|
+
| 3 | {{task_3_description}} | {{subtask_3_key}} | {{subtask_count_3}} |
|
|
428
|
+
|
|
429
|
+
**Statistics:**
|
|
430
|
+
- Subtasks Created: {{task_count}}
|
|
431
|
+
- Total Checklist Items: {{subtask_count}}
|
|
432
|
+
- Parent Story: {{story_key}}
|
|
433
|
+
- Project: {{project_key}}
|
|
434
|
+
- All Issues Assigned To: {{user_display_name}}
|
|
435
|
+
|
|
436
|
+
**Jira Links:**
|
|
437
|
+
- Story: {{jira_url}}/browse/{{story_key}}
|
|
438
|
+
- Subtask 1: {{jira_url}}/browse/{{subtask_1_key}}
|
|
439
|
+
- Subtask 2: {{jira_url}}/browse/{{subtask_2_key}}
|
|
440
|
+
- Subtask 3: {{jira_url}}/browse/{{subtask_3_key}}
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
#### Step 10: Update Story Document with Jira Links
|
|
444
|
+
|
|
445
|
+
**CRITICAL:** Always update the story document with Jira references for traceability
|
|
446
|
+
|
|
447
|
+
**Action:** Add Jira issue keys to the story document
|
|
448
|
+
|
|
449
|
+
```output
|
|
450
|
+
🔄 Updating story document with Jira links...
|
|
451
|
+
📄 File: {{story_file_path}}
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
**Update Strategy:**
|
|
455
|
+
|
|
456
|
+
1. **Add Jira Keys Inline to Tasks:**
|
|
457
|
+
- Locate each task checkbox in the Tasks / Subtasks section
|
|
458
|
+
- Append Jira key after task description: `- [ ] **Task N: Description** (AC: X) [{{SUBTASK_KEY}}]`
|
|
459
|
+
- Example: `- [ ] **Task 1: Create Solution Structure** (AC: 1, 4) [PM-31]`
|
|
460
|
+
|
|
461
|
+
2. **Keep subtasks as-is** (they are now in the Jira Subtask description)
|
|
462
|
+
|
|
463
|
+
3. **Add Jira Synchronization Section:**
|
|
464
|
+
- After the Tasks / Subtasks section, add a new section:
|
|
465
|
+
|
|
466
|
+
```markdown
|
|
467
|
+
## Jira Synchronization
|
|
468
|
+
|
|
469
|
+
**Sync Date:** {{current_date}}
|
|
470
|
+
**Parent Story:** [{{story_key}}]({{jira_url}}/browse/{{story_key}})
|
|
471
|
+
**Assigned To:** {{user_display_name}}
|
|
472
|
+
**Project:** {{project_key}}
|
|
473
|
+
|
|
474
|
+
### Task to Subtask Mappings
|
|
475
|
+
|
|
476
|
+
| Story Task | Jira Subtask | Link | Checklist Items |
|
|
477
|
+
|------------|--------------|------|-----------------|
|
|
478
|
+
| Task 1: {{task_1_desc}} | {{subtask_1_key}} | [View]({{jira_url}}/browse/{{subtask_1_key}}) | {{count_1}} |
|
|
479
|
+
| Task 2: {{task_2_desc}} | {{subtask_2_key}} | [View]({{jira_url}}/browse/{{subtask_2_key}}) | {{count_2}} |
|
|
480
|
+
| Task 3: {{task_3_desc}} | {{subtask_3_key}} | [View]({{jira_url}}/browse/{{subtask_3_key}}) | {{count_3}} |
|
|
481
|
+
|
|
482
|
+
**Total Jira Subtasks:** {{task_count}}
|
|
483
|
+
**Total Checklist Items:** {{subtask_count}}
|
|
484
|
+
|
|
485
|
+
**Important:**
|
|
486
|
+
- After synchronization, Jira becomes the source of truth for task status
|
|
487
|
+
- Each Jira Subtask contains a checklist with the original story subtasks
|
|
488
|
+
- Track progress in Jira and update checkboxes there
|
|
489
|
+
- Update this document only after completing all work
|
|
490
|
+
|
|
491
|
+
---
|
|
492
|
+
*Synchronized by PO Agent - sync-story-to-jira task on {{current_date}}*
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
**Expected Output:**
|
|
496
|
+
```output
|
|
497
|
+
✅ Story document updated with Jira links
|
|
498
|
+
✅ Inline keys added to {{task_count}} tasks
|
|
499
|
+
✅ Jira Synchronization section added
|
|
500
|
+
✅ File saved: {{story_file_path}}
|
|
501
|
+
|
|
502
|
+
Traceability established between story document and Jira subtasks.
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
#### Step 11: Generate Final Report
|
|
506
|
+
|
|
507
|
+
```output
|
|
508
|
+
═══════════════════════════════════════════════════════════════
|
|
509
|
+
JIRA SYNC COMPLETE - Story Tasks Synchronized
|
|
510
|
+
═══════════════════════════════════════════════════════════════
|
|
511
|
+
|
|
512
|
+
Story: {{story_title}}
|
|
513
|
+
Status: ✓ Synchronized to Jira
|
|
514
|
+
|
|
515
|
+
Parent Story: {{story_key}}
|
|
516
|
+
Subtasks Created: {{task_count}}
|
|
517
|
+
Checklist Items: {{subtask_count}}
|
|
518
|
+
Assigned To: {{user_display_name}}
|
|
519
|
+
|
|
520
|
+
Hierarchy in Jira:
|
|
521
|
+
{{story_key}} (Story) ← Assigned to {{user_display_name}}
|
|
522
|
+
├── {{subtask_1_key}} (Subtask) - Task 1
|
|
523
|
+
├── {{subtask_2_key}} (Subtask) - Task 2
|
|
524
|
+
└── {{subtask_3_key}} (Subtask) - Task 3
|
|
525
|
+
|
|
526
|
+
Next Steps:
|
|
527
|
+
1. Review subtasks in Jira: {{jira_url}}/browse/{{story_key}}
|
|
528
|
+
2. Each subtask has a checklist - use it to track progress
|
|
529
|
+
3. Story is ready for development - use `*develop-story` command with dev agent
|
|
530
|
+
4. Track progress through Jira board
|
|
531
|
+
|
|
532
|
+
Note: The story document has been updated with Jira mappings.
|
|
533
|
+
Original subtasks are now checklists within each Jira Subtask.
|
|
534
|
+
Changes should be made in Jira, which is now the source of truth.
|
|
535
|
+
|
|
536
|
+
═══════════════════════════════════════════════════════════════
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
## Success Criteria
|
|
540
|
+
|
|
541
|
+
The story sync is successful when:
|
|
542
|
+
|
|
543
|
+
1. Story status validated as "Approved"
|
|
544
|
+
2. All tasks extracted and parsed correctly
|
|
545
|
+
3. Parent story assigned to authenticated user
|
|
546
|
+
4. All tasks created as Jira Subtasks under the story
|
|
547
|
+
5. Each Subtask description contains the original subtasks as a checklist
|
|
548
|
+
6. Story document updated with Jira mappings
|
|
549
|
+
7. Traceability maintained between story document and Jira
|
|
550
|
+
|
|
551
|
+
## Error Handling
|
|
552
|
+
|
|
553
|
+
### Story Not Approved
|
|
554
|
+
```output
|
|
555
|
+
❌ ERROR: Story status is "{{current_status}}" but must be "Approved"
|
|
556
|
+
|
|
557
|
+
Resolution:
|
|
558
|
+
1. Run `*validate-story-draft` to validate the story
|
|
559
|
+
2. Address any validation issues
|
|
560
|
+
3. Update Status to "Approved"
|
|
561
|
+
4. Retry sync operation
|
|
562
|
+
```
|
|
563
|
+
|
|
564
|
+
### Missing Jira Configuration
|
|
565
|
+
```output
|
|
566
|
+
❌ ERROR: Jira configuration incomplete
|
|
567
|
+
|
|
568
|
+
Missing: {{missing_config_items}}
|
|
569
|
+
|
|
570
|
+
Resolution:
|
|
571
|
+
1. Run `*jira-setup` command to configure Jira integration
|
|
572
|
+
2. Ensure docs/jira-conf.md exists with project settings
|
|
573
|
+
3. Retry sync operation
|
|
574
|
+
```
|
|
575
|
+
|
|
576
|
+
### Parent Story Not Found
|
|
577
|
+
```output
|
|
578
|
+
❌ ERROR: Parent story {{story_key}} not found in Jira
|
|
579
|
+
|
|
580
|
+
Resolution:
|
|
581
|
+
1. Verify story key is correct
|
|
582
|
+
2. Create parent story in Jira first using PM agent
|
|
583
|
+
3. Or search Jira for existing story
|
|
584
|
+
4. Retry sync with correct story key
|
|
585
|
+
```
|
|
586
|
+
|
|
587
|
+
### Subtask Creation Failure
|
|
588
|
+
```output
|
|
589
|
+
❌ ERROR: Failed to create subtask: {{task_description}}
|
|
590
|
+
|
|
591
|
+
Error: {{error_message}}
|
|
592
|
+
|
|
593
|
+
Resolution:
|
|
594
|
+
1. Check Jira permissions
|
|
595
|
+
2. Verify Subtask issue type ID is correct in jira-preferences.md
|
|
596
|
+
3. Retry failed subtask creation
|
|
597
|
+
4. Contact Jira admin if permissions issue
|
|
598
|
+
```
|
|
599
|
+
|
|
600
|
+
### Cannot Get Authenticated User
|
|
601
|
+
```output
|
|
602
|
+
❌ ERROR: Unable to retrieve authenticated Jira user
|
|
603
|
+
|
|
604
|
+
Resolution:
|
|
605
|
+
1. Verify MCP Jira connection is active
|
|
606
|
+
2. Run `/mcp` to reconnect if needed
|
|
607
|
+
3. Ensure your Jira account has proper permissions
|
|
608
|
+
4. Retry sync operation
|
|
609
|
+
```
|
|
610
|
+
|
|
611
|
+
## Important Notes
|
|
612
|
+
|
|
613
|
+
- **Status Requirement:** Story MUST be in "Approved" status (not Draft, InProgress, Review, or Done)
|
|
614
|
+
- **Hierarchy Constraint:** Tasks become Subtasks (Jira doesn't allow Tasks as children of Stories)
|
|
615
|
+
- **Subtasks as Checklists:** Original story subtasks are embedded in each Jira Subtask description
|
|
616
|
+
- **Auto-Assignment:** Story is automatically assigned to the authenticated Jira user
|
|
617
|
+
- **One-Way Sync:** This creates Jira issues from story document (not bidirectional)
|
|
618
|
+
- **Source of Truth:** After sync, Jira becomes source of truth for task status
|
|
619
|
+
- **Duplicate Detection:** Task automatically detects previously synced stories and offers skip/force options
|
|
620
|
+
- **Parent Story Required:** Story must exist in Jira before syncing tasks
|
|
621
|
+
- **Dev Agent Requirement:** This is required before dev agent can begin implementation
|
|
622
|
+
|
|
623
|
+
## Related Commands
|
|
624
|
+
|
|
625
|
+
- `*validate-story-draft` - Validate story before approval
|
|
626
|
+
- `*create-story` - Create a new story document
|
|
627
|
+
- `*jira-setup` - Configure Jira integration
|
|
628
|
+
- `*develop-story` - Begin development (requires approved story with Jira sync)
|