Last active
September 30, 2020 09:42
-
-
Save tugce/8f3c5fd76a7f2c124505d75a921c052c to your computer and use it in GitHub Desktop.
Code snippet for Copado license assignment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
copado.GlobalAPI copadoGlobalAPI = new copado.GlobalAPI(); | |
copado.GlobalAPI.UserLicense UL = new copado.GlobalAPI.UserLicense(); | |
UL.isCADEnabled = false; //Agile delivery license | |
UL.isCCHEnabled = false; //Compliance hub license | |
UL.isCCMEnabled = true; //Change management (developer) license | |
UL.isCopadoEnabled = true; //Enterprise (admin / release manager) license | |
UL.isCSTEnabled = true; //Copado Selenium testing license | |
UL.userId = UserInfo.getUserId(); | |
copado.GlobalAPI.LicenseOperationResult result = copadoGlobalAPI.upsertCopadoLicense(UL); | |
if(result.isSuccess){ | |
System.debug('License assigned successfully'); | |
} else { | |
System.debug('An error occurred during license assignment with the error message ' + result.errorString); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment