Script Runner - Setting up a Service in JIRA Data Center

We are looking to set up a Service to run a script on a monthly schedule. with JIRA Data Center, my scripts "root" is on the shared drive. When setting up the Service, will the Data Center "replication" copy the Service out to all of the servers in the cluster or do I need to create the Service on each of the servers?




1 answer

So, Escalation Services are all configured to run once per cluster. The same is true of scheduled jobs in ScriptRunner for Bitbucket Server, Confluence, and Bamboo. That makes sense, since the presumed use case for scheduled jobs in ScriptRunner is that you'll want to do things that manipulate the database; per Atlassian's documentation, such operations should be run once per cluster.

For the plain ol' Jira Services that use the GroovyService class, the answer really depends more on Atlassian, and how they schedule services that are configured via the UI. I've been poking through Atlassian's docs and source but haven't found a definitive answer yet. I'll let you know if & when I do.

Well, simply through experiment, I've been able to deduce that Jira Services are not run locally by default, meaning they'll only be run once per cluster, just like the Escalation Service. I configured a Groovy Service, then ran this script, which logged "false".

import com.atlassian.jira.component.ComponentAccessor
import com.onresolve.jira.groovy.GroovyService

def serviceManager = ComponentAccessor.serviceManager
def services =
def firstGroovyService = services.find { it.serviceClass == }
log.warn firstGroovyService.isLocalService()

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Oct 11, 2018 in Marketplace Apps

You + one app + a desert island...

Hi all! My name is Miles and I work on the Marketplace team. We’re looking for better ways to recommend and suggest apps that are truly crowd favorites, so of course we wanted to poll the Community. ...

2,576 views 5 6
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you