My post function on the create transition is not firing, or if it is firing isn't updating the issue. What I am trying to do is, if the issue created is a story, to move the issue immediately forward to a certain part of the workflow. I've tested the post function on transitions other than the create transition and it works fine. I have also tried re-ordering the post functions with the script going first, last, in-between.
I've also added two post functions that might be interfering with it.
- Creates the issue originally.
- Set issue status to the linked status of the destination workflow step.
- Stores updates to an issue (no change history is created).
- Re-index an issue to keep indexes in sync with the database.
- Fire a Issue Created event that can be processed by the listeners.
#Jython code
from com.atlassian.jira.component import ComponentAccessor
if (issue.getIssueType().name == "Story"):
currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
issueService = ComponentAccessor.getIssueService()
issueInputParameter = issueService.newIssueInputParameters()
transitionValidationResult = issueService.validateTransition(currentUser, issue.getId(),101, issueInputParameter)
if transitionValidationResult.isValid():
issueService.transition(currentUser, transitionValidationResult)