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

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.

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 ?

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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

355 views 0 6
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