| name | dx-devops-work-item-manage |
| description | Use this skill to manage the full lifecycle of DevOps Center work items — list, create, update, commit changes, perform status transitions, and create pull requests. Update fields like subject, description, and status. Commit and push code changes to work item branches. Create pull requests for work item branches via DevOps Center API. Invoke when the user wants to track, find, create, or update a work item, commit changes to a work item branch, advance a work item's status through the pipeline, or create a pull request for code review. Consolidates sf devops work-item and review operations. DO NOT TRIGGER for promotion or deployment operations, or conflict detection. |
| metadata | {"version":"1.0","minApiVersion":"58.0","cliTools":[{"tool":["sf"],"semver":">=2.0.0"},{"tool":["git"],"semver":">=2.0.0"},{"tool":["jq"],"semver":">=1.6"}]} |
DevOps Center Work Item Management
Manages the complete work item lifecycle in DevOps Center — from creation through status transitions to promotion readiness. Provides headless CLI-driven operations for autonomous release workflows.
Scope
- In scope: List work items, create new work items, commit changes to work item branches, update work item fields (subject, description, status), transition work item status (New → In Progress → Ready to Promote), create pull requests for work item branches
- Out of scope: Promotion/deployment, conflict detection, pipeline or project management (separate skills)
Required Inputs
Gather or infer before proceeding:
- Operation type: list, create, update, commit, or create-review
- For list: project ID (required) — obtain via
sf devops project list --json if not provided
- For create: project ID (required), subject (required), description (optional)
- For commit: work item name or ID (required) to retrieve branch name, files to commit, commit message
- For update: work item name (e.g., WI-000001) or work item ID (required), fields to update (subject, description, status)
- For create-review: work item name (e.g., WI-000001) or work item ID (required)
Defaults unless specified:
- Output format:
--json for headless consumption
- Work item identifier: prefer
--work-item-name (WI-000001) over --work-item-id when both are available (names are human-readable)
If the user provides a clear request ("list work items for Project Alpha", "create work item to fix login bug", "move WI-12345 to In Progress", "create PR for WI-12345"), proceed immediately without unnecessary questions.
Workflow
All operations use sf devops work-item CLI commands with --json output for structured consumption.
Phase 1 — Identify Operation
- Determine the operation type from user intent:
- Keywords like "list", "show", "find" → list operation
- Keywords like "create", "new", "add" → create operation
- Keywords like "commit", "push", "save changes", "git commit" → commit operation
- Keywords like "update", "change", "modify", "edit", "move", "transition", "advance", "mark as" → update operation
- Keywords like "create PR", "pull request", "code review", "review", "open PR" → create-review operation
Phase 2 — Execute Operation
-
Verify org authentication before any operation:
sf org display --json
-
List work items — when the user wants to see existing work items:
sf devops work-item list --project-id <project-id> --json
-
Create a work item — when the user wants to create a new work item:
sf devops work-item create \
--project-id <project-id> \
--subject "<subject>" \
--description "<description>" \
--json
--project-id is required (obtain from user or via sf devops project list --json)
--subject is required (user-facing title)
--description is optional (defaults to blank if omitted)
- Capture the returned work item name (e.g., WI-000001), branch name, and environment from JSON output for future operations
- Idempotent: if the user attempts to create a duplicate (same subject + project), check via list first and return the existing work item
-
Execute commit operation — when operation type is commit:
-
Update work item — when the user wants to change subject, description, or status:
sf devops work-item update \
--work-item-name <WI-name> \
--subject "<new-subject>" \
--description "<new-description>" \
--status "<In Progress|Ready to Promote>" \
--json
-
Create pull request — when the user wants to create a PR for code review:
sf devops review create \
--work-item-name <WI-name> \
--json
Phase 3 — Verify and Report
-
Verify operation success:
- For list: confirm the CLI returned status 0, parse the JSON
.result[] array, and verify it contains work items (or is empty if no matches). If the user specified a project by name, confirm the resolved project ID matches.
- For create: verify the CLI returned status 0 and the JSON output contains
.result.name (work item ID like WI-000001), .result.branch (branch name), and .result.environment fields.
- For commit: verify each git command returned exit code 0. If
git push succeeds, the commit is saved to the work item branch.
- For update (general fields): verify the CLI returned status 0 and compare the returned JSON fields against the user's requested changes. If updating subject, confirm
.result.subject matches the new value.
- For update (status transition): verify the CLI returned status 0, then explicitly confirm the status transition by checking
.result.status in the JSON response matches the target status (e.g., "Ready to Promote"). If the response doesn't include the status field, re-run sf devops work-item list filtered to this work item and verify the status persisted.
- For create-review: verify the CLI returned status 0 and the JSON output contains
.result.pullRequestUrl (the PR URL) and .result.status (should be "open" or equivalent). If VCS credentials are missing, the CLI returns an error — surface this to the user.
-
Report results:
- List: present work items in a readable format showing work item name, subject, status, branch, and environment. If filtering by status was requested, show only matching work items.
- Create: return the work item name (e.g., WI-000001), branch name, environment, and confirm "Work item created successfully."
- Commit: confirm which files were staged, the commit SHA (from git output), and "Changes committed and pushed to branch ."
- Update (general): confirm which fields changed with before/after values (e.g., "Subject updated from 'X' to 'Y'").
- Status transition: explicitly state the transition with old → new status (e.g., "Status updated: In Progress → Ready to Promote").
- Create-review: return the PR URL and confirm "Pull request created successfully. Status: open. URL: "
Rules / Constraints
| Constraint | Rationale |
|---|
All sf devops commands must use --json flag | Structured output is required for headless consumption; human-readable output is unreliable for parsing |
| Work item identifier required for commit, update, and create-review | Use --work-item-name (preferred) or --work-item-id; obtain from list or prior create |
| Project ID required for list and create | All work items belong to a project; use sf devops project list --json if not provided |
| At least one update field required | Update command fails if no --subject, --description, or --status flag is provided |
| Status values must be exact strings | "In Progress" and "Ready to Promote" (with spaces, proper capitalization); other values fail |
| Idempotent create operations | Check for existing work item with same subject + project before creating duplicates |
| Changes must be committed before status transition to Ready to Promote | DevOps Center validates that the work item branch has commits before allowing promotion readiness |
| PR creation requires VCS credentials in org | DevOps Center API uses stored VCS credentials; no local git auth needed |
| Never use interactive prompts | Skills run in headless environments; all inputs must be via CLI flags |
Gotchas
| Issue | Resolution |
|---|
| No default org set | Run sf org display --json first; if it fails, instruct user to run sf org login web --set-default |
| User provides work item by subject, not name | Resolve via: sf devops work-item list --project-id <id> --json | jq -r '.result[] | select(.subject == "<subject>") | .name'; then pass the returned name to the update/create-review command |
| User provides project by name, not ID | First run sf devops project list --json and filter .result[] by .name field to find the project ID, then use that ID in the list/create command |
| Status update response missing status field | The CLI doesn't always return the status field in the update response; re-run sf devops work-item list filtered to this work item and check .result[0].status to verify the transition persisted |
| Work item not found | User provided invalid work item name/ID; run list command to show available work items |
| Invalid status value | Only "In Progress" and "Ready to Promote" are valid (exact strings with spaces); check spelling and capitalization |
| Project not found | User provided invalid project ID; run sf devops project list --json to show available projects |
| Duplicate work item subject | Idempotent create check should catch this; return existing work item name instead of creating duplicate |
| Git push fails - no commits or branch not found | Verify files are staged with git status and branch name retrieved from work item via list command |
| PR creation fails - VCS credentials | VCS credentials not configured in DevOps Center UI; instruct user to configure in Setup → DevOps Center → VCS Credentials |
Output Expectations
Deliverables vary by operation:
- List: JSON array of work items with work item name (WI-######), subject, branch, environment, repository details
- Create: Work item name (e.g., WI-000001), ID, branch name, and environment of the newly created work item
- Commit: Confirmation of git commit and push success, with commit SHA
- Update: Confirmation of updated fields (old value → new value for subject/description, or status change)
- Create-review: Pull request URL, PR number, and status
Outputs are derived from sf devops work-item CLI, sf devops review create CLI, and standard git commands.
Verification Checklist
Before reporting results to the user:
Universal Checks
List Operation Checks
Create Operation Checks
Commit Operation Checks
Update Operation Checks
Create-Review Operation Checks
Reference File Index
| File | When to read |
|---|
references/cli-commands.md | When you need detailed CLI flag documentation, JSON output schemas, or error handling patterns |
examples/common-workflows.md | When the user's request matches a common pattern (bulk updates, reassignment, idempotent creation, sequential transitions) |