public Map<String, Object> toMap(Map transientVars, ApplicationUser user, MutableIssue issue) { final WorkflowEntry entry = (WorkflowEntry) transientVars.get(ENTRY); final ImmutableMap.Builder<String, Object> transition = ImmutableMap.builder(); final Integer actionId = (Integer) transientVars.get(ACTION_ID); final WorkflowDescriptor workflowDescriptor = (WorkflowDescriptor) transientVars.get(WORKFLOW_DESCRIPTOR); final ActionDescriptor actionDescriptor = workflowDescriptor.getAction(actionId); final Step createdStep = (Step) transientVars.get(CREATED_STEP); final WorkflowStore workflowStore = (WorkflowStore) transientVars.get(WORKFLOW_STORE); transition.put(WORKFLOW_ID, entry.getId()) .put(WORKFLOW_NAME, entry.getWorkflowName()) .put(TRANSITION_ID, actionId) .put(TRANSITION_NAME, actionDescriptor.getName()) .put(FROM_STATUS, findPreviousStatus(createdStep, entry, workflowStore, workflowDescriptor)) .put(TO_STATUS, getToStatus(workflowDescriptor, createdStep)); final ImmutableMap.Builder<String, Object> transitionContext = ImmutableMap.builder(); transitionContext.put(TRANSITION_CONTEXT, transition.build()) .put(COMMENT, transientVars.get(COMMENT) != null ? transientVars.get(COMMENT) : "") .put(USER, user != null ? userBeanFactory.createBean(user) : ""); transitionContext.put(ISSUE, issueBeanFactory.createBean(issue)); transitionContext.put(TIMESTAMP, createdStep.getStartDate().getTime()); return transitionContext.build(); }