What is wrong?
For some reason, I have to update the "Last updated date" field of an issue. To update the field directly in a code of the developed plugin, I usually do something like that:
com.atlassian.jira.issue.IssueManager issueMgr = /* injecting */;
com.atlassian.jira.issue.index.IssueIndexManager issueIdxMgr = /* injecting */;
MutableIssue issue = issueMgr.getIssueObject(/* existing issue key */);
issue.setUpdated(/* timestamp in the past */);
issue.store();
issueMgr.updateIssue(currentUserOrAdmin, issue,
EventDispatchOption.ISSUE_UPDATED, /* sendMail */ false);
issueIdxMgr.reIndexIssueObjects(Collections.singletonList(issue));
This code allows issue updating and works perfectly. An adventure begins when we use a scrum board that contains the modifiable issue. The issue just disappears on the scrum board right after its Last updated field is updated by the code above. The issue is not visible on the Active sprints page as well as on the Backlog page (in sprint sections) - it's a problem.
Workarounds I found to fix the situation (make the issue visible again) are:
1) Manually update the issue status. I'm guessing that it may be a trigger for some internal indexing in Jira;
2) Reindex the project from the Project setting page;
3) Some others approaches that I wouldn't discuss here.
I'm guessing that to fix it I need to reindex (update somehow) agile boards containing the issue.
For now, I see only one option from above that can be implemented in the code: use Java API to reindex the project:
com.atlassian.jira.bc.project.index.ProjectReindexService projectIdxSrv = /* injecting */;
projectIdxSrv.reindex(issue.getProjectObject());
after that, all related Agile Boards have the correct set of issues, but I'm afraid that such an approach is not good enough - at least, it's maybe too slow.
Question
Does anybody know any approach to update/reindex the exact scrum board from a plugin code? For this aim which service/manager classes are available for injecting in a plugin? Which dependency do I need to add to the plugin project to have those classes?