Groovyscript as JIRA service does not run

Hello scripting experts,

I have an example script which shall run as a JIRA service. Code:

def message = "Hello Scriptrunner, this is a Test"
log.info message;
log.debug message;
log.error message;
println message;
return message;

The script is physically existing in the file system.
Executing the file over the "Script Console" works as expected.

Now I created a JIRA service, strictly using the documentation and the FAQ from this board. As schedule I chose "Daily every 15 minutes" because I wanted to see something in the log.

However, the service is not running. In atlassian-jira.log and catalina.out, there is no indication, that it tries to run. Altough I see other services, for example "Git Repository Imports", there is nothing about the Scriptrunner.

My system is a JIRA 7.0.10, Scriptrunner 4.2.0.4 on SLES 11.

What can I do to get the service run regularly?

3 answers

1 accepted

This widget could not be displayed.

Hi all,

I found the problem. The hint with "JIRA Data Center" solved the problem. The service is executed either on Node 1 or 2. I found the other executions on the second node.

Thanks for your help.

This widget could not be displayed.

Hi Stefan

The 'from this board' link is missing so I suppose you mean https://scriptrunner.adaptavist.com/latest/jira/services.html. I can see your script all it does is trying to log a message. You said that you used the same script in script console so does this mean that you actually saw the logs or just the 'return message'. What I am trying to say is, do you have logs for SR enabled ?

This widget could not be displayed.

Hi Thanos,

thanks for your reply. Yes, I took the documentation you linked to.

As suggested in https://answers.atlassian.com/questions/181197 I modified my script in Line 1 with

log.setLevel(org.apache.log4j.Level.DEBUG)

For the next run, I took again "Every 15 minutes" in the service-configuration.

Now I can see some executions, but definitely not every 15 minutes. It may execute - but not guaranteed.

 

Here is the example log. The expected run at 9:30 was not logged:

catalina.out.2016-02-18-13-08-41:2016-02-18 09:15:00,118 Caesium-1-3 
ERROR anonymous    Groovy-Sync 
[onresolve.scriptrunner.runner.ScriptRunnerImpl] Hello Scriptrunner, 
this is a Test
catalina.out.2016-02-18-13-08-41:2016-02-18 
09:45:00,157 Caesium-1-3 INFO anonymous    Groovy-Sync 
[onresolve.scriptrunner.runner.ScriptRunnerImpl] Hello Scriptrunner, 
this is a Test

 

Maybe another detail: It's a JIRA Data Center.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 22, 2018 in Marketplace Apps

How a Marketplace app tech team is achieving gender diversity

Hello! My name is Genevieve Blanch, and I'm the Marketing Manager at RefinedWiki, creators of apps to give teams the tools to customize Atlassian platforms. Currently, 44% of the tech team at Re...

508 views 3 18
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