Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-61325

Add 'Schedule Re-index' button for scheduling it to an appropriate date and time

    • 15
    • 15
    • We collect Jira feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      NOTE: This suggestion is for JIRA Server. Using JIRA Cloud? See the corresponding suggestion.

      Problem Definition

      As a JIRA Administrator, I would like to be able to manually schedule a one-time 'Lock JIRA and rebuild index' action, so that it can take place without blocking users at a time when they might be still working on JIRA, and without requiring me to actually click the Re-Index button at such an inconvenient time.

      Suggested Solution

      Workaround

      Trigger Full reindex using REST API and schedule it use Cron job.

          Form Name

            [JRASERVER-61325] Add 'Schedule Re-index' button for scheduling it to an appropriate date and time

            Vibin added a comment -

            This Would be useful.

            Vibin added a comment - This Would be useful.

            Henry Lin added a comment -

            thanks, @Timony!

            Henry Lin added a comment - thanks, @Timony!

            Timothy McClain added a comment - - edited

            @Henry Lin

            It's fairly basic but here it is.
            The rest call is made over 8080 as opposed to the secured port because I kept getting SSL errors and couldnt be bothered. as for the authstring, you need to literally convert username:password to base64 and use that. There may be other 'more secure' ways to auth, but this has worked for all rest calls I've needed to make. I run this as a daily job, but obviously you can set it to as frequently as you need it to.
             
            String authString = "your base64 encoded username:password"
             
            String url = "server-url:8080/rest/api/2/reindex?type=FOREGROUND"
             
            def post = (HttpURLConnection) new URL(url).openConnection();
            post.addRequestProperty("Authorization", "Basic "+authString);
            post.setRequestMethod("POST");
            post.connect();
             
            int status = post.getResponseCode();
             
            switch (status)

            {     case 200:     case 202:         log.warn("Reindex Started.")         break;     case 404:         log.warn("404 Error received.")         break;     default:         return "Unsuccessful" }

               
            return "Great Success"

            Timothy McClain added a comment - - edited @Henry Lin It's fairly basic but here it is. The rest call is made over 8080 as opposed to the secured port because I kept getting SSL errors and couldnt be bothered. as for the authstring, you need to literally convert username:password to base64 and use that. There may be other 'more secure' ways to auth, but this has worked for all rest calls I've needed to make. I run this as a daily job, but obviously you can set it to as frequently as you need it to.   String authString = " your base64 encoded username:password "   String url = " server-url :8080/rest/api/2/reindex?type=FOREGROUND"   def post = (HttpURLConnection) new URL(url).openConnection(); post.addRequestProperty("Authorization", "Basic "+authString); post.setRequestMethod("POST"); post.connect();   int status = post.getResponseCode();   switch (status) {     case 200:     case 202:         log.warn("Reindex Started.")         break;     case 404:         log.warn("404 Error received.")         break;     default:         return "Unsuccessful" }     return "Great Success"

            Henry Lin added a comment -

            @Timothy McClain, do you mind share your Scriptrunner script/repo? 

            Henry Lin added a comment - @Timothy McClain, do you mind share your Scriptrunner script/repo? 

            For those interested that use Scriptrunner, I have a job script that performs this function.

            Timothy McClain added a comment - For those interested that use Scriptrunner, I have a job script that performs this function.

            SKanagala added a comment -

            It is very helpful feature for admins.

            SKanagala added a comment - It is very helpful feature for admins.

            That is time saving!

            Job Wolters added a comment - That is time saving!

            Very interested in this functionality.

            Timothy McClain added a comment - Very interested in this functionality.

            This would be a great enhancement to have.

             

            Christie Leone added a comment - This would be a great enhancement to have.  

            Derek Mart added a comment -

            Why isn't this already a thing for such a seasoned application that requires reindexing every time you make any number of changes?

            Derek Mart added a comment - Why isn't this already a thing for such a seasoned application that requires reindexing every time you make any number of changes?

            Schedule re-index would be a great option for automating re-indexing. It will save time and also have the software performs well and well maintained.

            Md Saifur Rahman added a comment - Schedule re-index would be a great option for automating re-indexing. It will save time and also have the software performs well and well maintained.

            ahmad.asi added a comment -

            It would be great to have a schedule re-indexing.

            ahmad.asi added a comment - It would be great to have a schedule re-indexing.

            Isaac.nl added a comment -

            We also would like this. Everytime we make a small change to Jira, the reindex popup comes up notifying us of the need for reindexing. Would be a time saver if it just ran every night, no need to make a process around triggering the reindexing manually. Please note it's not feasible to perform the reindxing after every change, because sometimes you need multiple changes or iterative improvements and once an re-index job is running, you need to wait until it finishes to trigger it again.

            Isaac.nl added a comment - We also would like this. Everytime we make a small change to Jira, the reindex popup comes up notifying us of the need for reindexing. Would be a time saver if it just ran every night, no need to make a process around triggering the reindexing manually. Please note it's not feasible to perform the reindxing after every change, because sometimes you need multiple changes or iterative improvements and once an re-index job is running, you need to wait until it finishes to trigger it again.

            Please make this feature available, in a 24 hrs economy this will def. help.

            Department added a comment - Please make this feature available, in a 24 hrs economy this will def. help.

            +1 for scheduling this job (Schedule RE-index)

            Alex Gubar added a comment - +1 for scheduling this job (Schedule RE-index)

            +1 for this one,

            In my company it's almost not possible to do background re-indexing, it's taking up to 8 hours, and crashing very often (when configuration is being change during reindexing). I need re-indexing night hours - after working hours. It would be great to have schegule button.

             

             

            Joanna Bajda added a comment - +1 for this one, In my company it's almost not possible to do background re-indexing, it's taking up to 8 hours, and crashing very often (when configuration is being change during reindexing). I need re-indexing night hours - after working hours. It would be great to have schegule button.    

            This would be great! I wouldn't have to wait until the middle of the night to do this

            Jeff Tillett added a comment - This would be great! I wouldn't have to wait until the middle of the night to do this

            Bruce Reed added a comment -

            This is a great idea, but I might question why you even need a manual reindex process in the app. Seems to be a design flaw if administrators need to worry about this and are warned about it somewhat frequently as is the case for our instance. If anything, the background reindex should be automatic. It's a system function!

            Bruce Reed added a comment - This is a great idea, but I might question why you even need a manual reindex process in the app. Seems to be a design flaw if administrators need to worry about this and are warned about it somewhat frequently as is the case for our instance. If anything, the background reindex should be automatic. It's a system function!

            I would like to support this suggestion as well.

            Jacob Saaby Nielsen added a comment - I would like to support this suggestion as well.

            I would extend this to the background re-index as well. I want my JIRA instance to be able to reindex at an off hour (middle of the night, etc.).

            Jacob Shanesy added a comment - I would extend this to the background re-index as well. I want my JIRA instance to be able to reindex at an off hour (middle of the night, etc.).

            Yes, this would be very helpful.

            Nancy Belser added a comment - Yes, this would be very helpful.

              Unassigned Unassigned
              5c52af3a81d4 Ignacio Pulgar
              Votes:
              259 Vote for this issue
              Watchers:
              121 Start watching this issue

                Created:
                Updated: