Server Administration > Automate Tasks and Calculate Data Using Event Triggers > Using the Integrity Lifecycle Manager API in Event Triggers > API Trigger Code
 
API Trigger Code
The following API trigger code performs the equivalent functionality of the
si createcp --issueID=101 command:
//Get the bean
var eb=bsf.lookupBean (“sienviornmentBean”);’

//Create an API session bean
var apiSession = eb.createAPISessionBean();

//Create the command
var command = new Packages.com.api.Command (“si”, “createcp”);
command.addOption (new Packages.com.mks.apt.Option (“issueId”, currentID));

//Execute the command and get the response
var response = apiSession.executeCmd (command);