Post function on Create transition not working

Thienky Dang March 11, 2019

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.

  1. Creates the issue originally.
  2. Set issue status to the linked status of the destination workflow step.
  3. Stores updates to an issue (no change history is created).
  4. Re-index an issue to keep indexes in sync with the database.
  5. 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)

4 answers

0 votes
Archana Bellamkonda January 31, 2023

Same issue here. Wondering if anyone figured out a solution.

0 votes
Mike Baker February 21, 2020

Did anybody find a resolution to this?

 

Thanks

Mike

0 votes
Sibi_K December 30, 2019

Hi guys,

Any update, We are also facing the same problem that the script works in the other transition but create transition.

 

Thanks,

Sibi.K

0 votes
Akalpit October 23, 2019

Same here.

Suggest an answer

Log in or Sign up to answer