public void execute(Map transientVars, Map args, PropertySet ps)
throws WorkflowException {
MutableIssue mIssue = (MutableIssue) transientVars.get("issue");
ComponentManager componentManager = ComponentManager.getInstance();
final CustomFieldManager customFieldManager = componentManager.getCustomFieldManager();
final Priority priorityObject = mIssue.getPriorityObject();
final String name = priorityObject.getName();
if (name != null && name.startsWith(SLAServiceJob.PRIORITY_1))
{
final Project project = mIssue.getProjectObject();
final GenericValue securityLevel = mIssue.getSecurityLevel();
final ClientSLAConfig clientSLAConfiguration = SLAServiceJob.getClientSLAConfiguration(securityLevel.getString("name"), project.getName());
if (clientSLAConfiguration != null)
{
final String p1ResponseSLA = clientSLAConfiguration.getP1ResponseSLA();
if (p1ResponseSLA != null && p1ResponseSLA.trim().length() > 0)
{
User user;
try {
user = UserUtils.getUser(SLAServiceJob.getSLAServiceUserName());
} catch (EntityNotFoundException e) {
e.printStackTrace();
throw new WorkflowException(e.getMessage());
}
final IssueManager issueManager = componentManager.getIssueManager();
SLAServiceJob.dispatchEvent(mIssue, user, issueManager, customFieldManager, SLAServiceJob.P1_RAISED_EVENT);
}
}
}
}