Hello, and welcome to Another Salesforce Blog! Here I will be posting solutions to problems that I couldn’t find an answer to in hopes of helping those who find themselves stuck when using the Salesforce platform.
Today we are going to cover a worst case scenario. Something was deployed to Production that shouldn’t have been, but we don’t know which deployment holds the answer. The UI for deployments is clunky and doesn’t allow us to see who deployed what without clicking into the individual deployment. This is a hassle, especially when the clock is ticking!
Using the Tooling API DeployRequest object, which is unfortunately not listed in the Salesforce documentation as of the writing of this post, we can query who deployed what and when to narrow down our search.
The Tooling API allows us to query for different metadata types to retrieve smaller pieces of metadata. Per the Salesforce documentation, we want to use the Tooling API when we need “fine-grained access to an org’s metadata.”
In order to solve for this, we are going to enter into the Developer Console in the org that we want to query from. From the Developer Console, we are going to navigate to the Query Editor, and check the “Use Tooling API” box by the “Execute” button.
From here, we are going to enter the following query:
SELECT Id, Status, StartDate, CompletedDate, createdBy.Name FROM DeployRequest
This will give us the ID of the
DeployRequest record, the Status, pertinent date information, and the name of who initiated the deployment in the org.
Unfortunately, we are not able to specify a
WHERE clause in our query as of this writing – doing so results in an unspecified query error.
To complete this in WorkBench using the REST Explorer, we can use the following URI with a
This makes for a more manageable set of data, as we can show the Raw Response in Workbench and manipulate it accordingly.
Thanks for reading, let me know if you have any comments or questions!
Another Salesforce Blog
Make a one-time donation
Make a monthly donation
Make a yearly donation
Choose an amount
Or enter a custom amount
Help keep Another Salesforce Blog on the internet by donating today!
Your contribution is appreciated.
Your contribution is appreciated.DonateDonate monthlyDonate yearly