I'm trying to change the status of an issue programmatically in a post function.
It seems like I am able to change the status of the issue but when I view the status of the issue on the issue page, it still shows the previous issue. In the activity log, it shows that the issue was changed.
This is a problem that I have seen in a few posts but a solution was never given in those threads.
I made sure that my post function runs before the indexing and I also tried indexing the issue in the code itself.
This is the code I have that does the transition.
Only when I get the post function to execute a second time, does the issue show the correct status in the UI.
this.validationResult = service.validateTransition(user, issue.getId(), actionId, issueInputParameters);
if(this.validationResult.isValid()) {
service.transition(user, validationResult);
reindexIssue(issue);
}