How to Delete a Specific Work Item from Salesforce DevOps Center

How to Delete a Specific Work Item from Salesforce DevOps Center

In Salesforce DevOps Center, each Work Item is associated with related change submissions and remote changes. Due to the object hierarchy and lookup relationships, direct deletion of a work Item is not allowed until its dependent records are deleted first.

If you’re using Salesforce DevOps tools, understanding this dependency structure is crucial. This document outlines the proper order and SOQL queries needed to safely delete a specific Work Item (sf_devops__Work_Item__c) along with its related Change Submissions and Remote Changes.

This approach aligns with best practices in DevOps for Salesforce, where structured change management and rollback options are essential.

Object Relationship Hierarchy

The deletion must follow this parent-child hierarchy:

Object Relationship Hierarchy with Salesforce DevOps - Sigma

Each Remote Change record is linked to a Change Submission, which in turn is linked to a Work Item. This layered relationship is typical in DevOps tools for Salesforce projects, where traceability is crucial.

Also Read: DevOps Center – The New Deployment Tool

Steps to Delete a Work Item

1. Identify the Work Item Record

To fetch the specific Work Item you wish to delete:

Identify the Work Item Record with Salesforce DevOps

Replace ‘WI-XXXXX’ with the actual Work Item name. Accurate identification of records is a key aspect of managing environments in DevOps and Salesforce projects.

2. Find the Associated Change Submissions

Once you have the Work Item, query the related Change Submissions:

Find the Associated Change Submissions with Salesforce DevOps

This provides a list of all Change Submissions linked to the Work Item, which is crucial when managing dependencies using Salesforce DevOps.

3. Retrieve the Related Remote Changes

For each Change Submission retrieved above, get the corresponding Remote Change records:

Retrieve the Related Remote Changes with Salesforce DevOps
Replace ‘CS-00113’ with the actual Change Submission name. Using Salesforce DevOps tools helps ensure that these records are consistently tracked and maintained.

Also Read: BayCorp Breach – Tightening Salesforce Security

Deletion Sequence

To delete the Work Item successfully, you must delete the records in the following order due to parent-child dependencies:

  1. Delete Remote Change(s) (sf_devops__Remote_Change__c)
  2. Delete Change Submission(s) (sf_devops__Change_Submission__c)
  3. Delete Work Item (sf_devops__Work_Item__c)

This sequence is critical in environments using DevOps for Salesforce to avoid integrity issues.

Deletion Sequence in Salesforce DevOps

Notes

  • Also, ensure the corresponding branch is also deleted.
  • Ensure no other dependencies or deployments are linked to the Work Item before deletion.
  • Consider backing up data before deletion for audit or recovery purposes—this is a standard precaution when working with DevOps and Salesforce practices.

Conclusion

Deleting a Work Item in Salesforce DevOps Center involves understanding and respecting the object relationships. Always begin by deleting dependent Remote Changes, followed by Change Submissions, and finally the Work Item itself.

Following this structured deletion process ensures data integrity and aligns with industry-standard practices in Salesforce DevOps environments.

Looking for result-oriented Salesforce consulting services tailored to your business needs? Leverage Sigma Infosolutions’ Salesforce capabilities for a positive growth trajectory!