Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

issueService.transition() does not update status of issue

Mason Cooper April 25, 2018

I'm attempting to create a Java plugin that reopens and updates a field on a closed ticket via a WebworkAction/UI Button.

The 'Reopen' workflow succeeds without errors, and the UI even reflects a successfully 'Reopened' ticket, giving me workflow options only available to open tickets (such as the option to 'Close'). 

However, the status is still listed as 'Closed'. 

Reading through the ages on this, I haven't been able to find a good solution-- it seems like this has been broken at least since 2012, with solutions varying but generally falling back on implementing a fixed time delay. I can't imagine a bug/problem like this has lingered in the API for nearly a decade like this, and am hoping someone can help me figure this out.

I'm using code as described in the platform documentation. The function's javadoc indicates that all parts of the transition (reindex/etc) should occur during the call.

IssueInputParameters issueInputParameters = issueService.newIssueInputParameters();
issueInputParameters.setAssigneeId("newdude");

IssueService issueService = ComponentAccessor.getInstance().getIssueService();

TransitionValidationResult transitionValidationResult = issueService.validateTransition(user, 12345L, 10000L, issueInputParameters);

if (transitionValidationResult.isValid())
{
    IssueResult transitionResult = issueService.transition(user, transitionValidationResult);
    if (!transitionResult.isValid())
    {
        // Do something
    }
}


There seem to be literally dozens of posts like this one, all of varying detail/specificity/outrage, none with an actual solution. Hear's to hoping this is the one that provides clarity!

1 answer

0 votes
Mason Cooper April 26, 2018

This isn't expected to be an answer, rather a collection of past answers to similar problems.

A brief collection of the first page of Google results includes:

Mason Cooper April 26, 2018

I've also attempted manually forcing a reindex and issue update, which appears to properly transition the ticket some of the time, but inconsistently (and leaning towards not working most of the time). I think this goes into the timing related issues pointed out in 509411. 

The javadoc, however, clearly states that the transition function should 'update' the issue, among its other functions, which is what appears to not be happening here.

Mason Cooper April 27, 2018

It looks like you can make an event listener, and have that trigger the transition, but the transition is not necessarily successful when called with other component types. As far as I can tell the docs don't indicate any limitation on the transition/why this might be.

Yann Follet September 14, 2018

I got the same problem and I solve it an other way

I put auto transition in the workflow (export workflow to xml, modify xml and import it)

sample in the xml : <action id="31" name="toNextPhase" auto="true">

and I control the transition by condition in the workflow

I wish this can help

 

an other post for auto transition Here

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events