Skip to content

Instantly share code, notes, and snippets.

@tugce
Last active September 30, 2020 09:42
Show Gist options
  • Save tugce/8f3c5fd76a7f2c124505d75a921c052c to your computer and use it in GitHub Desktop.
Save tugce/8f3c5fd76a7f2c124505d75a921c052c to your computer and use it in GitHub Desktop.
Code snippet for Copado license assignment
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