I'm using the following snippet of code in a workflow post-function that is being used only by sub-tasks. I'm transitioning the parent task. In this context issueToBeApproved is set to the parent issue and is a MutableIssue. The transitionActionId is correct and the transition succeeds and shows as a transition on the Transitions Summary tab on the Jira issue page. But the status remains unchanged and still indicates the original linked status, not the new linked status. If I manually click the transition button on the parent issue then the transition works as expected.
I can't see anything written anywhere about having to explicitly set the status field after the transition, so where am I going wrong?
User user = jiraAuthenticationContext.getLoggedInUser(); boolean transitionFailed = true; log.warn("Validating workflow transition action id " + transitionActionId + " on " + issueToBeApproved.getKey()); IssueService.TransitionValidationResult transitionValidationResult = issueService.validateTransition(user, issueToBeApproved.getId(), transitionActionId, issueService.newIssueInputParameters()); if (transitionValidationResult.isValid()) { log.warn("Running workflow transition action id " + transitionActionId + " on " + issueToBeApproved.getKey()); IssueService.IssueResult issueResult = issueService.transition(user, transitionValidationResult); if (issueResult.isValid()) { transitionFailed = false; } }
Many thanks,
Andrew.
Community moderators have prevented the ability to post new answers.
Same for me on Jira 6...
Your solution is working on JIRA7 : {code} issueService.transition(u, tvr); issue.setStatusObject(ir.getIssue().getStatusObject()); issueManager.updateIssue(u, issue, EventDispatchOption.ISSUE_UPDATED, false); {code}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Seb's workaround not working for me on Jira 6.2.3. I tried the reindex as well, no luck.
Anyone know if this is an acknowledged bug?
This is quite frustrating.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Seb's workaround not working for me on Jira 6.2.3. I tried the reindex as well, no luck.
Anyone know if this is an acknowledged bug?
This is quite frustrating.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, yeah for me that sounds like a bug. In my opinion, issueService.transition should take care of the whole process. Glad to know it helped you :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I found a way to make this work:
IssueResult ir =
issueService.transition(u, tvr);
issue.setStatusObject(ir.getIssue().getStatusObject());
issueManager.updateIssue(u, issue, EventDispatchOption.ISSUE_UPDATED, false);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
same behavior...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I use sth. like this to perform a re-index... Just a thought...
issueIndexManager.reIndex(validationResult.getIssue())
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.