A Most Basic Example to Test Custom Script Execution
Copy the following code to a test.groovy file. Place the file into the path mentioned in the parent wiki. Set up the workflow action in a tracker that has "Story Points" field. Execute the state transition, the "Story Points" field value shall be set to 10.
package com.intland.codebeamer.workflow
import com.intland.codebeamer.persistence.dto.*;
import com.intland.codebeamer.persistence.dto.base.*;
import com.intland.codebeamer.persistence.dao.*;
import com.intland.codebeamer.manager.*;
import com.intland.codebeamer.controller.importexport.*;
import org.apache.commons.lang3.*;
if (!beforeEvent) {
return; // do NOTHING on after-event, everything is already handled in the before-event!
}
logger.info("-------------------------------------");
logger.info("Setting Story Point field value to 10 in: " + subject);
subject.setStoryPoints(10);