Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Script Runner - Setting up a Service in JIRA Data Center

Jeanne Howe (PVD AUG) November 14, 2017

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

0 votes
Jonny Carter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 29, 2017

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.

Jonny Carter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 30, 2017

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
TAGS
AUG Leaders

Atlassian Community Events