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?

 

Cheers,

Jeanne

1 answer

This widget could not be displayed.

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 = serviceManager.services
def firstGroovyService = services.find { it.serviceClass == GroovyService.name }
log.warn firstGroovyService.isLocalService()

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Published 9 hours ago in Marketplace Apps

The 7 hacks of highly successful automation

...there's anything I've learnt from working, it's that people are lazy! No offense to anyone reading this, but it's true and we can all admit it. The easier you make something for someone, the more...

54 views 0 8
Read article

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