org_config Object Reference¶
The org_config object can be used in the cumulusci.yml file to read a large number number of attributes of the Salesforce org currently used. For example, in a custom flow step, you can use a when clause to adapt the behavior of the new step to the type of org (scratch org or not) by referencing the org_config.scratch attribute.
The following information is documented here in the application’s source code : https://github.com/SFDO-Tooling/CumulusCI/blob/main/cumulusci/core/config/org_config.py
org_config Object Attributes¶
access_token: access token currently used to authenticate with Salesforceinstalled_packages: comma-separated list of package names; adictmapping a namespace or metadata package ID (starts with033) to the installed package version(s) matching that identifier. All values are lists, because multiple second-generation packages may be installed with the same namespace. The beta version of a package is represented as “1.2.3b5”, where 5 is the build number.instance_url: eghttps://crazy-demo.scratch.my.salesforce.cominstance_name: egcrazy-demois_advanced_currency_management_enabled:trueorfalseis_multiple_currencies_enabled:trueorfalseis_person_accounts_enabled:trueorfalseis_sandbox:trueif the org is a sandboxis_survey_advanced_features_enabled:trueorfalselightning_base_url: base url ending with.lightning.force.comnamespace: namespace of the orgnamespaced:trueif the org has a namespaceorg_id: Organization ID of the Salesforce orgorg_type: eg “Enterprise Edition” or “Developer Edition”organization_sobject: The Organization object (see the Salesforce documentation for the Organization SObject) for the org.scratch:Truewhen the org is a scratch org.start_url: the frontdoor URL that results in an instant login, likehttps://mydomain.my.salesforce.com/secur/frontdoor.jsp?sid=...user_id: user ID of the current Salesforce useruserinfo: user OAuth2 information (see https://help.salesforce.com/s/articleView?id=sf.remoteaccess_using_userinfo_endpoint.htm)username: username of the current Salesforce user
Other org_config Object Attributes¶
config_fileconfig_namelatest_api_versionnamesalesforce_clientsfdx_alias
org_config Object Methods¶
has_minimum_package_version(package_identifier, version_identifier):trueif the org has a version of the specified package that is equal to or newer than the supplied version identifier. The package identifier may be either a namespace or a033MetadataPackage ID. The version identifier should be in “1.2.3” or “1.2.3b4” format.whenexpressions can use thehas_minimum_package_versionmethod to check if a package is installed with a sufficient version.For example:
when: org_config.has_minimum_package_version("namespace", "1.0")See a real-life example here : https://trailhead.salesforce.com/fr/trailblazer-community/feed/0D54V00007erukZSAQ
get_community_info(community_name, force_refresh=False): Returns the community information for the given community (see https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_responses_community.htm)An API call will be made the first time this method is used, and the return values will be cached. Subsequent calls will not call the API unless the requested community name is not in the cached results, or unless the force_refresh parameter is set to True