mcpField
C
creating-fix-work-item

creating-fix-work-item

github.com/forcedotcomTesting & quality1.1k257 installsUpdated 1d ago
Repository

About creating-fix-work-item

An Agent skill that creates a DevOps Center fix work item from test-failure analysis, with a project and assignee. It presents the details and requires explicit confirmation before creation.

Key features

  1. 01Create fix work items
  2. 02Set the project and assignee
  3. 03Confirm item details before creation
  4. 04Translate common errors into plain language

Use cases

  1. 01Create a work item from test-failure analysis
  2. 02Assign a fix item to a specified developer

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/forcedotcom/sf-skills --skill creating-fix-work-item

After installing, type/creating-fix-work-itemin Claude Code to confirm it loaded.

Details

From the project README

Prerequisites

Load checking-devops-prerequisites first — Prerequisites 1–4. You need doce-org-alias, the DevopsProjectId to file under, and an OwnerId (assignee). If no DevopsProject exists, surface that the work item cannot be created until a project exists.

Inputs required before creating

InputHow to obtain
DevopsProjectIdFrom the pipeline's associated project — query DevopsProject WHERE Name = '<projectName>' on the doce org if not already known
SubjectDerived from failure analysis — e.g. "Fix: Missing code-analyzer-v5.yml workflow in blitz-10-06 repository"
OwnerIdUser ID of the developer to assign to — query SELECT Id, Name FROM User WHERE Username = '<username>' on the doce org if not known. Ask the user if the username is unknown.
doce-org-aliasEstablished in Prerequisites

Confirmation gate

Before creating the work item, show a summary and wait for explicit confirmation:

"I'll create a fix work item with the following details:

  • Subject: <subject>
  • Assigned to: <assigneeName>
  • Project: <projectName>

Shall I create it?"

Do not proceed until the user confirms.

Creating the work item

sf data create record \
  --sobject WorkItem \
  --values "Subject='<subject>' DevopsProjectId='<DevopsProjectId>' OwnerId='<OwnerId>'" \
  --target-org <doce-org-alias> \
  --json

Important: Use WorkItem (no namespace) — DevopsWorkItem is not a supported sObject in this org version.

On success

Parse the returned id from the result and confirm:

"Fix work item created (<id>): <subject>. Assigned to <assigneeName> in the <projectName> project."

Error handling

Never expose raw API error messages. Map errors to plain-language responses:

ErrorResponse
FIELD_INTEGRITY_EXCEPTION"The assignee ID is invalid. Let me look up the correct user ID — what's the developer's username?"
REQUIRED_FIELD_MISSING"A required field is missing. Check that Subject and DevopsProjectId are both provided."
INSUFFICIENT_ACCESS"Your user doesn't have permission to create work items in this project."
Any other error"The work item could not be created. Error: <plain summary>. Try again or create it manually in DevOps Center."

Related skills

  • analyzing-test-failures — provides the failure analysis and improvement suggestions that motivate creating a fix work item

Comments

Markdown supported