Hello All,
I am trying to Re-Index the all issues in a project for every 1 minute with the Script Runner Escalation services using below script. However, it is Re-Indexing only particular issue every time.
import com.atlassian.jira.issue.index.IssueIndexingService import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.Issue import com.atlassian.jira.util.ImportUtils import org.apache.log4j.Category def issueManager = ComponentAccessor.getIssueManager() def issueIndexingService = ComponentAccessor.getComponent(IssueIndexingService) boolean wasIndexing = ImportUtils.isIndexIssues(); ImportUtils.setIndexIssues(true); log.warn("Reindex issue ${issue.key} ${issue.id}") issueIndexingService.reIndex(issueManager.getIssueObject(issue.id)); ImportUtils.setIndexIssues(wasIndexing);
Can any one please help.
Thanks in Advance,
Mani
>Re-Index the all issues in a project for every 1 minute
WHY???
This is something you should never never even start to think about doing. It will consume a massive amount of resources for no benefit I can work out.
What makes you think you want to do this? Could we look at fixing whatever is making you think you want to do it instead of implementing a really bad solution?
Hi Nic,
We want to prioritize and sort the issues based on a Calculation custom field values.
Currently, once the calculation field is updated issues are not sorting in ASC or DESC order.
However, issues are prioritizing and sorting accordingly once we Re-index the project. Re-Index Project is only available for Jira administrators, Project admins cannot come to us every time to Re-index the project after updating the custom field.
So we decided to run a script every minute so all issues will Re-index. If you think it is not a right way of doing could you please suggest any other method?
Thanks in Advance,
Mani
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't "think is is not right", it is utterly utterly wrong. If you do this every minute, you're going to load your server to the point of uselessness within seconds.
You need to look at what you are doing with this "prioritisation" that is failing so badly - any proper change of an issue will index it correctly, and it sounds like what you are doing is broken because it is not.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.