I am using Scriptrunner and I would like to throw an exception because the issue has no components as shown below:
How can I do that?
I am using the following code and I am checking if the components are empty but the error is not thrown. How can I fix this?
package SuperFeature
import com.opensymphony.workflow.WorkflowException
def components = issue.components
log.warn("MOUNA COMPONENTS "+components)
if(components.empty) {
log.warn("MOUNA EMPTY")
throw new WorkflowException("Issue does not have components")
}