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!