we are using script runner heavily in our organization and recently while working on one of the requirement, we encountered an issue where we have to transition a workflow using one groovy script which is triggered from one transition as post function and perform multiple transitions using issueService.transition() method. The script ran fine but it was not updating the status, However, everything looks good in the change history. To fix this I used issue.setStatsObject(status[1]) method and everything looks good now. My question is though the status should have been mapped automatically, is it ok to use setStatusObject() method, using this method will not cause any impact on the JIRA database or overall to JIRA? I have added the snippet of my code below.
if (validationResult.isValid()) { issueService.transition(user, validationResult) issue.setStatusObject(status[1]) issueIndexMgr.reIndex(validationResult.getIssue()) }