How to access Production items through Objectscript?
How do I access items and their settings of production by using Objectscript? I have already tried making SQL queries to Ens_Config.Production table and using methods in Ens.Director and EnsPortal.Utils classes but I just can't get a hang of it.
The unfortunate reason, why I need to do this, is that our environments (DEV, QA and PROD) have gone in really bad shape over the years and now the software development is just pure agony since environments are not in sync. Comparing different environments is also extremely difficult since it is hard to even tell which classes are in use. The idea was to go through all the items in production class, label "archived" business hosts which are disabled and list classes that they are using. Maybe even removing these unused hosts and classes automatically. This way it would be easier to compare environments and make necessary changes to accomplish CI/CD pipelines one day.
Does anyone have any ideas how this could be done? Ens.Director class's method getProductionItems() seems quite obvious but I don't know how to use it.