Skip to content

essentialkaos/jira-reindex-runner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

20fb073 · Jun 23, 2024
Jun 14, 2024
Jun 23, 2024
Jun 23, 2024
Jul 17, 2021
Mar 31, 2022
Apr 18, 2023
Jul 17, 2021
Jun 14, 2024
Jun 23, 2024
Jul 17, 2021
Jun 23, 2024
Jun 23, 2024
Mar 28, 2024

Codebeat badge GitHub Actions CI Status GitHub Actions CodeQL Status

InstallationUsageCI StatusContributingLicense


jira-reindex-runner is an app for periodical running Jira re-index process.

Due to the lack of Jira functionality, it is impossible to check if a re-index is required or not. For using this app, you must have ScriptRunner add-on installed on your Jira instance. Then you have to create a new REST endpoint in ScriptRunner with the following code:

import com.onresolve.scriptrunner.runner.rest.common.CustomEndpointDelegate
import groovy.json.JsonBuilder
import groovy.transform.BaseScript
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.config.DefaultReindexMessageManager

import javax.ws.rs.core.MultivaluedMap
import javax.ws.rs.core.Response

@BaseScript CustomEndpointDelegate delegate

reindexRequired(httpMethod: "GET", groups: ["jira-administrators"]) { MultivaluedMap queryParams, String body ->
  def rmm = ComponentAccessor.getComponent(DefaultReindexMessageManager.class)
  def msg = rmm.getMessageObject()

  if (msg == null) {
    return Response.ok(new JsonBuilder([required: false]).toString()).build();
  }

  return Response.ok(new JsonBuilder([required: true, user: msg.getUserName(), date: msg.getTime()]).toString()).build();
}

Using this endpoint, our app can check if re-index is required and run it.

Installation

From source

Make sure you have a working Go 1.21+ workspace (instructions), then:

go install github.com/essentialkaos/jira-reindex-runner@latest
sudo dnf install -y https://pkgs.kaos.st/kaos-repo-latest.el$(grep 'CPE_NAME' /etc/os-release | tr -d '"' | cut -d':' -f5).noarch.rpm
sudo dnf install jira-reindex-runner

CI Status

Branch Status
master CI
develop CI

Contributing

Before contributing to this project please read our Contributing Guidelines.

License

Apache License, Version 2.0