function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
NaveenReddyNaveenReddy 

How to get a list of change sets in a sandbox

Hi ,

Any one pls help me in finding list of change sets that are available in a sandbox.

either through SOQL query or any API etc..

Urgent pls..??

Thanks in advance
sfdc Beginnersfdc Beginner
Go to setup ==> Deploy == > Outbound Change Sets/ Inbound Change Sets
NaveenReddyNaveenReddy
Thanks, But my question is...

Not through the user interface..

Is there any way to find out the number of change sets(Inbound or Outbound) in a sandbox.

query or any method or by writing some code not with by setup-->deploy-->change sets
bob_buzzardbob_buzzard
No, because the change set information is metadata rather than regular data, and is not available through Apex code.  You may be able to scrape the information from the setup page via apex - I've had some success accessing license information this way.  This example code captures the HTML from that page and outputs it to the debug log:

PageReference pr=new PageReference('/changemgmt/listInboundChangeSet.apexp');
Blob output=pr.getContent();
System.debug('### Content = \n' + output.toString());

NaveenReddyNaveenReddy
Thank you bob for your valued info. 

Is there any otherway to access the change sets like we get Packages or other metadata using metadata API.


Regards,
Naveen.