@salesforce/afv-skills 1.31.0 → 1.32.0
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/package.json +1 -1
- package/skills/agentforce-bot-upgrade/SKILL.md +217 -0
- package/skills/agentforce-bot-upgrade/references/extraction-blueprint.md +242 -0
- package/skills/agentforce-bot-upgrade/references/generate-agent-spec.md +128 -0
- package/skills/agentforce-bot-upgrade/references/handoff-output-format.md +208 -0
- package/skills/agentforce-bot-upgrade/references/input-contract.md +101 -0
- package/skills/agentforce-bot-upgrade/references/mapping-rules.md +113 -0
- package/skills/agentforce-bot-upgrade/references/planner-workflow-reference.md +78 -0
- package/skills/agentforce-bot-upgrade/references/post-conversion-enhancements-reference.md +67 -0
- package/skills/agentforce-bot-upgrade/references/quality-checklist.md +33 -0
- package/skills/agentforce-bot-upgrade/references/sf-cli-bot-reference.md +116 -0
- package/skills/dx-devops-work-item-manage/SKILL.md +270 -0
- package/skills/dx-devops-work-item-manage/examples/common-workflows.md +479 -0
- package/skills/dx-devops-work-item-manage/references/cli-commands.md +476 -0
- package/skills/dx-org-manage/SKILL.md +8 -5
- package/skills/dx-org-trial-expiration-check/SKILL.md +239 -0
- package/skills/dx-org-trial-expiration-check/scripts/check_expiration.sh +588 -0
- package/skills/experience-ui-bundle-app-coordinate/SKILL.md +12 -9
- package/skills/experience-ui-bundle-custom-app-generate/SKILL.md +29 -5
- package/skills/experience-ui-bundle-custom-app-generate/references/configure-metadata-custom-application.md +1 -1
- package/skills/experience-ui-bundle-custom-app-generate/scripts/resolve-uibundle-path.sh +30 -0
- package/skills/experience-ui-bundle-features-generate/SKILL.md +86 -11
- package/skills/experience-ui-bundle-features-generate/references/conflict-resolution-schema.json +20 -0
- package/skills/experience-ui-bundle-features-generate/scripts/verify-react-bundle.sh +14 -0
- package/skills/experience-ui-bundle-frontend-generate/SKILL.md +6 -1
- package/skills/experience-ui-bundle-frontend-generate/references/component.md +34 -1
- package/skills/experience-ui-bundle-frontend-generate/references/page.md +1 -1
- package/skills/experience-ui-bundle-project-generate/SKILL.md +111 -0
- package/skills/experience-ui-bundle-project-generate/scripts/flatten-project.mjs +33 -0
- package/skills/platform-custom-lightning-type-generate/SKILL.md +9 -14
- package/skills/platform-custom-lightning-type-generate/references/widget-rendition.md +27 -111
- package/skills/platform-lightning-type-widget-coordinate/SKILL.md +214 -0
- package/skills/platform-lightning-type-widget-coordinate/examples/existing-lightning-type-with-widget-prompt.md +80 -0
- package/skills/platform-lightning-type-widget-coordinate/examples/new-lightning-type-with-widget-prompt.md +75 -0
- package/skills/platform-lightning-type-widget-coordinate/references/build-plan-format.md +67 -0
- package/skills/platform-lightning-type-widget-coordinate/references/lightning-type-discovery.md +124 -0
- package/skills/platform-lightning-type-widget-coordinate/references/validation-gates.md +130 -0
- package/skills/platform-sharing-owd-configure/SKILL.md +142 -0
- package/skills/platform-sharing-owd-configure/examples/get_owd_output.md +38 -0
- package/skills/platform-sharing-owd-configure/examples/update_owd_output.md +44 -0
- package/skills/platform-sharing-owd-configure/references/access_levels.md +49 -0
- package/skills/platform-sharing-owd-configure/references/metadata_api_approach.md +69 -0
- package/skills/platform-sharing-rules-generate/SKILL.md +89 -19
- package/skills/platform-sharing-rules-generate/examples/test-cases.md +381 -0
- package/skills/platform-widget-generate/SKILL.md +241 -0
- package/skills/platform-widget-generate/examples/conditional.json +73 -0
- package/skills/platform-widget-generate/examples/list-with-foreach.json +66 -0
- package/skills/platform-widget-generate/examples/single-object.json +64 -0
- package/skills/platform-widget-generate/references/schema-from-lightning-type.md +76 -0
- package/skills/platform-widget-generate/references/widget-bundle-layout.md +116 -0
- package/skills/platform-widget-generate/references/widget-meta-directives.md +130 -0
- package/skills/sales-agentforce-pipeline-management-configure/SKILL.md +268 -0
- package/skills/sales-agentforce-pipeline-management-configure/assets/field-completion-template.genAiPromptTemplate-meta.xml +141 -0
- package/skills/sales-agentforce-pipeline-management-configure/assets/pipeline_management_flow.flow-meta.xml +548 -0
- package/skills/sales-agentforce-pipeline-management-configure/assets/sales_management_agent.agent +2938 -0
- package/skills/sales-agentforce-pipeline-management-configure/assets/sales_management_agent.bundle-meta.xml +4 -0
- package/skills/sales-agentforce-pipeline-management-configure/assets/sfdx-project.json +12 -0
- package/skills/sales-agentforce-pipeline-management-configure/assets/stage-descriptions/bant.txt +11 -0
- package/skills/sales-agentforce-pipeline-management-configure/assets/stage-descriptions/meddic.txt +11 -0
- package/skills/sales-agentforce-pipeline-management-configure/assets/stage-descriptions/spiced.txt +11 -0
- package/skills/sales-agentforce-pipeline-management-configure/examples/custom-prompt-instructions.md +317 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/admin-communication.md +355 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/agent-creation.md +383 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/auth-and-cli.md +146 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/automation-matrix.md +23 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/autonomous-updates.md +215 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/canonical-agent-path.md +75 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/data-sources.md +155 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/field-completion-prompt-template.md +120 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/field-completion-prompts.md +149 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/flags.md +13 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/flow-clone-from-template.md +447 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/metadata-inventory.md +330 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/opportunity-stages.md +246 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/repair-diagnostics.md +265 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/setup-order.md +263 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/soap-api-enablement.md +528 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/CHANGES.md +180 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/README.md +56 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/add-field-suggestion.sh +679 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/create-agent.sh +302 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/create-flow.sh +250 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/define-agent-access.sh +430 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/deploy-settings.sh +77 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/enable-deal-agent.sh +241 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/enable-prerequisites.sh +538 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/flow-debug-and-verify.sh +385 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/retrieve-settings.sh +131 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/setup-all.sh +2791 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/agent-bundle-publish.sh +189 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/agent-detection.sh +239 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/flow-builder.sh +238 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/psg.sh +48 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/soap.sh +140 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/stage-descriptions.sh +448 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/test-opp.sh +166 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/verify-all.sh +636 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/verify-prompt-generation.sh +346 -0
|
@@ -0,0 +1,479 @@
|
|
|
1
|
+
# Common Work Item Management Workflows
|
|
2
|
+
|
|
3
|
+
Real-world examples of typical work item operations in DevOps Center autonomous release scenarios.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Workflow 1: Full Lifecycle — Create, Develop, Commit, and PR
|
|
8
|
+
|
|
9
|
+
**User request:** "Create a work item for adding email validation to Contact records, implement it, then create a PR when done"
|
|
10
|
+
|
|
11
|
+
**Steps:**
|
|
12
|
+
|
|
13
|
+
1. **Get project ID** (if not already known):
|
|
14
|
+
```bash
|
|
15
|
+
sf devops project list --json
|
|
16
|
+
```
|
|
17
|
+
Output: Project ID `1Qg000000000001`
|
|
18
|
+
|
|
19
|
+
2. **Create work item**:
|
|
20
|
+
```bash
|
|
21
|
+
sf devops work-item create \
|
|
22
|
+
--project-id 1Qg000000000001 \
|
|
23
|
+
--subject "Add email validation to Contact" \
|
|
24
|
+
--description "Enforce @salesforce.com domain on Contact email field" \
|
|
25
|
+
--json
|
|
26
|
+
```
|
|
27
|
+
Output: Work item name `WI-000001`, branch name `feature/wi-000001-add-email-validation`
|
|
28
|
+
|
|
29
|
+
3. **Update status to In Progress** when development starts:
|
|
30
|
+
```bash
|
|
31
|
+
sf devops work-item update \
|
|
32
|
+
--work-item-name WI-000001 \
|
|
33
|
+
--status "In Progress" \
|
|
34
|
+
--json
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
4. **Make code changes on the work item branch**:
|
|
38
|
+
```bash
|
|
39
|
+
# Get branch name from work item
|
|
40
|
+
BRANCH=$(sf devops work-item list --project-id 1Qg000000000001 --json | \
|
|
41
|
+
jq -r '.result[] | select(.name == "WI-000001") | .branch')
|
|
42
|
+
|
|
43
|
+
# Checkout the branch
|
|
44
|
+
git checkout "$BRANCH"
|
|
45
|
+
|
|
46
|
+
# Make changes to files
|
|
47
|
+
# (user implements email validation here)
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
5. **Commit and push changes**:
|
|
51
|
+
```bash
|
|
52
|
+
git add force-app/main/default/objects/Contact/fields/Email.field-meta.xml
|
|
53
|
+
git commit -m "Add email validation rule for @salesforce.com domain"
|
|
54
|
+
git push origin "$BRANCH"
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
6. **Update status to Ready to Promote** when work is complete:
|
|
58
|
+
```bash
|
|
59
|
+
sf devops work-item update \
|
|
60
|
+
--work-item-name WI-000001 \
|
|
61
|
+
--status "Ready to Promote" \
|
|
62
|
+
--json
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
7. **Create pull request** for code review:
|
|
66
|
+
```bash
|
|
67
|
+
sf devops review create \
|
|
68
|
+
--work-item-name WI-000001 \
|
|
69
|
+
--json
|
|
70
|
+
```
|
|
71
|
+
Output: PR URL `https://github.com/org/repo/pull/42`
|
|
72
|
+
|
|
73
|
+
8. **List work items** to confirm final state:
|
|
74
|
+
```bash
|
|
75
|
+
sf devops work-item list --project-id 1Qg000000000001 --json | \
|
|
76
|
+
jq -r '.result[] | select(.name == "WI-000001") | {name, subject, status}'
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Workflow 2: Bulk Status Update for Promotion
|
|
82
|
+
|
|
83
|
+
**User request:** "Mark all work items with 'In Progress' status as Ready to Promote"
|
|
84
|
+
|
|
85
|
+
**Steps:**
|
|
86
|
+
|
|
87
|
+
1. **List work items in In Progress status**:
|
|
88
|
+
```bash
|
|
89
|
+
sf devops work-item list --project-id 1Qg000000000001 --json | \
|
|
90
|
+
jq -r '.result[] | select(.status == "In Progress") | .name'
|
|
91
|
+
```
|
|
92
|
+
Output: Work item names `WI-000001`, `WI-000002`
|
|
93
|
+
|
|
94
|
+
2. **Update each to Ready to Promote**:
|
|
95
|
+
```bash
|
|
96
|
+
for WI in WI-000001 WI-000002; do
|
|
97
|
+
sf devops work-item update \
|
|
98
|
+
--work-item-name $WI \
|
|
99
|
+
--status "Ready to Promote" \
|
|
100
|
+
--json
|
|
101
|
+
done
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
3. **Verify all transitioned**:
|
|
105
|
+
```bash
|
|
106
|
+
sf devops work-item list --project-id 1Qg000000000001 --json | \
|
|
107
|
+
jq -r '.result[] | select(.status == "Ready to Promote") | {name, subject}'
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Workflow 3: Commit Changes to Work Item Branch
|
|
113
|
+
|
|
114
|
+
**User request:** "I made changes to the Apex class for work item WI-000003, commit and push them"
|
|
115
|
+
|
|
116
|
+
**Steps:**
|
|
117
|
+
|
|
118
|
+
1. **Get the work item's branch name**:
|
|
119
|
+
```bash
|
|
120
|
+
BRANCH=$(sf devops work-item list --project-id 1Qg000000000001 --json | \
|
|
121
|
+
jq -r '.result[] | select(.name == "WI-000003") | .branch')
|
|
122
|
+
echo "Work item branch: $BRANCH"
|
|
123
|
+
```
|
|
124
|
+
Output: `feature/wi-000003-refactor-service`
|
|
125
|
+
|
|
126
|
+
2. **Checkout the work item branch** (if not already on it):
|
|
127
|
+
```bash
|
|
128
|
+
git checkout "$BRANCH"
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
3. **Stage the changed files**:
|
|
132
|
+
```bash
|
|
133
|
+
git add force-app/main/default/classes/AccountService.cls
|
|
134
|
+
git add force-app/main/default/classes/AccountService.cls-meta.xml
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
4. **Commit with a descriptive message**:
|
|
138
|
+
```bash
|
|
139
|
+
git commit -m "Refactor AccountService for better testability"
|
|
140
|
+
```
|
|
141
|
+
Output: Commit SHA `a1b2c3d4`
|
|
142
|
+
|
|
143
|
+
5. **Push to the work item branch**:
|
|
144
|
+
```bash
|
|
145
|
+
git push origin "$BRANCH"
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Workflow 4: Update Work Item After Requirements Change
|
|
151
|
+
|
|
152
|
+
**User request:** "Update work item WI-000001 subject to include P0 priority tag"
|
|
153
|
+
|
|
154
|
+
**Steps:**
|
|
155
|
+
|
|
156
|
+
1. **Update subject**:
|
|
157
|
+
```bash
|
|
158
|
+
sf devops work-item update \
|
|
159
|
+
--work-item-name WI-000001 \
|
|
160
|
+
--subject "[P0] Add email validation to Contact" \
|
|
161
|
+
--json
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
2. **Update description** with new requirements:
|
|
165
|
+
```bash
|
|
166
|
+
sf devops work-item update \
|
|
167
|
+
--work-item-name WI-000001 \
|
|
168
|
+
--description "UPDATED: Enforce @salesforce.com domain. Must deploy by EOD Friday." \
|
|
169
|
+
--json
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
3. **Update multiple fields at once** (alternative):
|
|
173
|
+
```bash
|
|
174
|
+
sf devops work-item update \
|
|
175
|
+
--work-item-name WI-000001 \
|
|
176
|
+
--subject "[P0] Add email validation to Contact" \
|
|
177
|
+
--description "UPDATED: Enforce @salesforce.com domain. Must deploy by EOD Friday." \
|
|
178
|
+
--json
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## Workflow 5: Find Work Items Ready for Promotion
|
|
184
|
+
|
|
185
|
+
**User request:** "Show me all work items ready to promote in Project Alpha"
|
|
186
|
+
|
|
187
|
+
**Steps:**
|
|
188
|
+
|
|
189
|
+
1. **Get project ID** (if using project name):
|
|
190
|
+
```bash
|
|
191
|
+
PROJECT_ID=$(sf devops project list --json | \
|
|
192
|
+
jq -r '.result[] | select(.name == "Project Alpha") | .id')
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
2. **List work items with Ready to Promote status**:
|
|
196
|
+
```bash
|
|
197
|
+
sf devops work-item list --project-id "$PROJECT_ID" --json | \
|
|
198
|
+
jq -r '.result[] | select(.status == "Ready to Promote") | {name, subject, branch}'
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
3. **Delegate to promotion skill**:
|
|
202
|
+
User intent is to promote these work items → delegate to `dx-devops-promote` skill with the work item names
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
## Workflow 6: Idempotent Work Item Creation
|
|
207
|
+
|
|
208
|
+
**User request:** "Create work item for API rate limit fix (if it doesn't exist)"
|
|
209
|
+
|
|
210
|
+
**Steps:**
|
|
211
|
+
|
|
212
|
+
1. **Check for existing work item**:
|
|
213
|
+
```bash
|
|
214
|
+
PROJECT_ID="1Qg000000000001"
|
|
215
|
+
SUBJECT="Fix API rate limit on bulk operations"
|
|
216
|
+
|
|
217
|
+
EXISTING_NAME=$(sf devops work-item list \
|
|
218
|
+
--project-id "$PROJECT_ID" \
|
|
219
|
+
--json | \
|
|
220
|
+
jq -r ".result[] | select(.subject == \"$SUBJECT\") | .name" | head -n1)
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
2. **Create only if not found**:
|
|
224
|
+
```bash
|
|
225
|
+
if [ -n "$EXISTING_NAME" ]; then
|
|
226
|
+
echo "Work item already exists: $EXISTING_NAME"
|
|
227
|
+
else
|
|
228
|
+
NEW_NAME=$(sf devops work-item create \
|
|
229
|
+
--project-id "$PROJECT_ID" \
|
|
230
|
+
--subject "$SUBJECT" \
|
|
231
|
+
--json | jq -r '.result.name')
|
|
232
|
+
echo "Created new work item: $NEW_NAME"
|
|
233
|
+
fi
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## Workflow 7: List Work Items with Filtering
|
|
239
|
+
|
|
240
|
+
**User request:** "Show me all work items in Project Beta that haven't been started yet"
|
|
241
|
+
|
|
242
|
+
**Steps:**
|
|
243
|
+
|
|
244
|
+
1. **List all work items and filter by status**:
|
|
245
|
+
```bash
|
|
246
|
+
PROJECT_ID="1Qg000000000002"
|
|
247
|
+
|
|
248
|
+
sf devops work-item list --project-id "$PROJECT_ID" --json | \
|
|
249
|
+
jq -r '.result[] | select(.status != "In Progress" and .status != "Ready to Promote") |
|
|
250
|
+
{name, subject, status, branch}'
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
2. **Alternative: show work items in progress**:
|
|
254
|
+
```bash
|
|
255
|
+
sf devops work-item list --project-id "$PROJECT_ID" --json | \
|
|
256
|
+
jq -r '.result[] | select(.status == "In Progress") |
|
|
257
|
+
"\(.name): \(.subject) (branch: \(.branch))"'
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## Workflow 8: Batch Create Work Items
|
|
263
|
+
|
|
264
|
+
**User request:** "Create work items for three bug fixes: login issue, search timeout, and export error"
|
|
265
|
+
|
|
266
|
+
**Steps:**
|
|
267
|
+
|
|
268
|
+
1. **Create each work item**:
|
|
269
|
+
```bash
|
|
270
|
+
PROJECT_ID="1Qg000000000001"
|
|
271
|
+
|
|
272
|
+
# Bug 1
|
|
273
|
+
WI1=$(sf devops work-item create \
|
|
274
|
+
--project-id "$PROJECT_ID" \
|
|
275
|
+
--subject "Fix login issue on mobile" \
|
|
276
|
+
--description "Users unable to authenticate on iOS 17+" \
|
|
277
|
+
--json | jq -r '.result.name')
|
|
278
|
+
|
|
279
|
+
# Bug 2
|
|
280
|
+
WI2=$(sf devops work-item create \
|
|
281
|
+
--project-id "$PROJECT_ID" \
|
|
282
|
+
--subject "Fix search timeout" \
|
|
283
|
+
--description "Search queries timing out for large datasets" \
|
|
284
|
+
--json | jq -r '.result.name')
|
|
285
|
+
|
|
286
|
+
# Bug 3
|
|
287
|
+
WI3=$(sf devops work-item create \
|
|
288
|
+
--project-id "$PROJECT_ID" \
|
|
289
|
+
--subject "Fix export error" \
|
|
290
|
+
--description "CSV export failing with special characters" \
|
|
291
|
+
--json | jq -r '.result.name')
|
|
292
|
+
|
|
293
|
+
echo "Created work items: $WI1, $WI2, $WI3"
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
|
|
298
|
+
## Workflow 9: Sequential Status Progression
|
|
299
|
+
|
|
300
|
+
**User request:** "Move work item WI-000005 from initial creation to Ready to Promote"
|
|
301
|
+
|
|
302
|
+
**Steps:**
|
|
303
|
+
|
|
304
|
+
1. **Verify current status**:
|
|
305
|
+
```bash
|
|
306
|
+
WORK_ITEM="WI-000005"
|
|
307
|
+
CURRENT_STATUS=$(sf devops work-item list --project-id 1Qg000000000001 --json | \
|
|
308
|
+
jq -r ".result[] | select(.name == \"$WORK_ITEM\") | .status")
|
|
309
|
+
echo "Current status: $CURRENT_STATUS"
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
2. **Update to In Progress** (if currently in initial state):
|
|
313
|
+
```bash
|
|
314
|
+
sf devops work-item update \
|
|
315
|
+
--work-item-name $WORK_ITEM \
|
|
316
|
+
--status "In Progress" \
|
|
317
|
+
--json
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
3. **Update to Ready to Promote** (when work is complete):
|
|
321
|
+
```bash
|
|
322
|
+
sf devops work-item update \
|
|
323
|
+
--work-item-name $WORK_ITEM \
|
|
324
|
+
--status "Ready to Promote" \
|
|
325
|
+
--json
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
4. **Verify final status**:
|
|
329
|
+
```bash
|
|
330
|
+
sf devops work-item list --project-id 1Qg000000000001 --json | \
|
|
331
|
+
jq -r ".result[] | select(.name == \"$WORK_ITEM\") | .status"
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
---
|
|
335
|
+
|
|
336
|
+
## Workflow 10: Get Work Item Details by Name
|
|
337
|
+
|
|
338
|
+
**User request:** "Show me all details for work item WI-000001"
|
|
339
|
+
|
|
340
|
+
**Steps:**
|
|
341
|
+
|
|
342
|
+
1. **List work items and filter by name**:
|
|
343
|
+
```bash
|
|
344
|
+
sf devops work-item list --project-id 1Qg000000000001 --json | \
|
|
345
|
+
jq '.result[] | select(.name == "WI-000001")'
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
2. **Extract specific fields**:
|
|
349
|
+
```bash
|
|
350
|
+
sf devops work-item list --project-id 1Qg000000000001 --json | \
|
|
351
|
+
jq -r '.result[] | select(.name == "WI-000001") |
|
|
352
|
+
"Name: \(.name)\nSubject: \(.subject)\nStatus: \(.status)\nBranch: \(.branch)\nEnvironment: \(.environment)\nDescription: \(.description)"'
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
---
|
|
356
|
+
|
|
357
|
+
## Workflow 11: Multi-Project Work Item Search
|
|
358
|
+
|
|
359
|
+
**User request:** "Find all work items across all projects with 'login' in the subject"
|
|
360
|
+
|
|
361
|
+
**Steps:**
|
|
362
|
+
|
|
363
|
+
1. **List all projects**:
|
|
364
|
+
```bash
|
|
365
|
+
sf devops project list --json | jq -r '.result[].id'
|
|
366
|
+
```
|
|
367
|
+
Output: Project IDs `1Qg000000000001`, `1Qg000000000002`
|
|
368
|
+
|
|
369
|
+
2. **Search each project for matching work items**:
|
|
370
|
+
```bash
|
|
371
|
+
for PROJECT_ID in 1Qg000000000001 1Qg000000000002; do
|
|
372
|
+
echo "Project: $PROJECT_ID"
|
|
373
|
+
sf devops work-item list --project-id "$PROJECT_ID" --json | \
|
|
374
|
+
jq -r '.result[] | select(.subject | contains("login")) |
|
|
375
|
+
" \(.name): \(.subject)"'
|
|
376
|
+
done
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
---
|
|
380
|
+
|
|
381
|
+
## Workflow 12: Create Work Item with Empty Description
|
|
382
|
+
|
|
383
|
+
**User request:** "Create work item 'Refactor user service' with no description"
|
|
384
|
+
|
|
385
|
+
**Steps:**
|
|
386
|
+
|
|
387
|
+
1. **Create without description flag** (defaults to blank):
|
|
388
|
+
```bash
|
|
389
|
+
sf devops work-item create \
|
|
390
|
+
--project-id 1Qg000000000001 \
|
|
391
|
+
--subject "Refactor user service" \
|
|
392
|
+
--json
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
2. **Add description later** (if needed):
|
|
396
|
+
```bash
|
|
397
|
+
sf devops work-item update \
|
|
398
|
+
--work-item-name WI-000006 \
|
|
399
|
+
--description "Refactor for better testability and performance" \
|
|
400
|
+
--json
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
---
|
|
404
|
+
|
|
405
|
+
## Workflow 13: Using Work Item ID Instead of Name
|
|
406
|
+
|
|
407
|
+
**User request:** "Update work item 0Wx000000000001AAA to Ready to Promote"
|
|
408
|
+
|
|
409
|
+
**Steps:**
|
|
410
|
+
|
|
411
|
+
1. **Update using work item ID**:
|
|
412
|
+
```bash
|
|
413
|
+
sf devops work-item update \
|
|
414
|
+
--work-item-id 0Wx000000000001AAA \
|
|
415
|
+
--status "Ready to Promote" \
|
|
416
|
+
--json
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
> **Note:** Work item IDs (like `0Wx000000000001AAA`) are less human-readable than names (like `WI-000001`). Prefer using `--work-item-name` when possible.
|
|
420
|
+
|
|
421
|
+
---
|
|
422
|
+
|
|
423
|
+
## Workflow 14: Bulk PR Creation
|
|
424
|
+
|
|
425
|
+
**User request:** "Create PRs for all work items that are Ready to Promote"
|
|
426
|
+
|
|
427
|
+
**Steps:**
|
|
428
|
+
|
|
429
|
+
1. **List work items with Ready to Promote status**:
|
|
430
|
+
```bash
|
|
431
|
+
sf devops work-item list --project-id 1Qg000000000001 --json | \
|
|
432
|
+
jq -r '.result[] | select(.status == "Ready to Promote") | .name'
|
|
433
|
+
```
|
|
434
|
+
Output: Work item names `WI-000001`, `WI-000003`, `WI-000005`
|
|
435
|
+
|
|
436
|
+
2. **Create PR for each work item**:
|
|
437
|
+
```bash
|
|
438
|
+
for WI in WI-000001 WI-000003 WI-000005; do
|
|
439
|
+
sf devops review create \
|
|
440
|
+
--work-item-name $WI \
|
|
441
|
+
--json | \
|
|
442
|
+
jq -r '.result.pullRequestUrl'
|
|
443
|
+
done
|
|
444
|
+
```
|
|
445
|
+
Output: PR URLs for each work item
|
|
446
|
+
|
|
447
|
+
3. **Verify PRs were created** by listing work items again and checking for associated review records:
|
|
448
|
+
```bash
|
|
449
|
+
sf devops work-item list --project-id 1Qg000000000001 --json | \
|
|
450
|
+
jq -r '.result[] | select(.name == "WI-000001" or .name == "WI-000003" or .name == "WI-000005") | {name, subject, status}'
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
---
|
|
454
|
+
|
|
455
|
+
## Workflow 15: Check if PR Already Exists Before Creating
|
|
456
|
+
|
|
457
|
+
**User request:** "Create a PR for WI-000002, but only if one doesn't already exist"
|
|
458
|
+
|
|
459
|
+
**Steps:**
|
|
460
|
+
|
|
461
|
+
1. **Attempt to create PR** and handle "PR already exists" error:
|
|
462
|
+
```bash
|
|
463
|
+
OUTPUT=$(sf devops review create --work-item-name WI-000002 --json)
|
|
464
|
+
STATUS=$(echo "$OUTPUT" | jq -r '.status')
|
|
465
|
+
|
|
466
|
+
if [ "$STATUS" -eq 0 ]; then
|
|
467
|
+
PR_URL=$(echo "$OUTPUT" | jq -r '.result.pullRequestUrl')
|
|
468
|
+
echo "PR created: $PR_URL"
|
|
469
|
+
else
|
|
470
|
+
ERROR_NAME=$(echo "$OUTPUT" | jq -r '.name')
|
|
471
|
+
if [ "$ERROR_NAME" = "PR_ALREADY_EXISTS" ]; then
|
|
472
|
+
echo "PR already exists for WI-000002"
|
|
473
|
+
else
|
|
474
|
+
echo "Error creating PR: $ERROR_NAME"
|
|
475
|
+
fi
|
|
476
|
+
fi
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
> **Note:** The CLI will return a non-zero status with error name `PR_ALREADY_EXISTS` if a PR already exists for that work item.
|