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

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 30, 2018 in Marketplace Apps

Three tips for boosting your board's efficiency with Story Maps

Trello is one of the most effective tools for driving your sprints. It's customizable for every Agile team and product owners and Scrum masters (SM) love it. However, Agile teams often struggle with:...

839 views 2 9
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