How can I trigger a groovy script on Jira startup

Dan C
Contributor
April 11, 2023

I need to run a groovy script when Jira first starts up.

I don't see any events that will allow me to do this.

 

I saw this other answer from quite a few years ago: but I'm not sure exactly what it means by "putting the script in the startup package".

 

I created a folder in scriptrunner's script editor named "startup", and added "package startup" to the top of the script, but that did not work.

 

Any help would be appreciated.

 

Thanks,

Dan

1 answer

1 vote
Matti Dennstaedt November 26, 2024

Dear Dan,

if you add a script to the folder "startup" inside the script editor and add the following content, you will see at the log that it does work:

package startup

import groovy.util.logging.Log4j2

@Log4j2
class RunOnStartUp {
RunOnStartUp() {
log.warn("it works fine")
}
}

The name of the script at startup should be RunOnStartUp.groovy (class name == file name).
Kind regards
Matti

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
9.4.4
TAGS
AUG Leaders

Atlassian Community Events