Script Runner: escalation service only works when previewed

Geert Graat
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.
October 15, 2014

Hi,

I am using the escalation service to transition issues. I have a JQL query which selects the issues to transition. The strange thing is that the query returns no results when the service runs (although it should). Previewing the service works fine.

To make sure nothing is wrong with my query, I changed it to issuekey = CSD-21. Below the log of a preview of the service and then the actual execution. Notice that there are no issues found during the service execution.

I am using the same user to execute the service as I am previewing the service with. This user has administrative privileges and can do everything with the issue.

Any ideas?

2014-10-16 11:56:33,722 http-bio-8080-exec-15 DEBUG admin 716x8556x1 1qrhfiw 172.24.1.59 /rest/scriptrunner/latest/canned/com.onresolve.scriptrunner.canned.jira.admin.EscalationService/params [canned.jira.admin.EscalationService] existing configs: 1
2014-10-16 11:56:36,406 http-bio-8080-exec-15 DEBUG admin 716x8558x1 1qrhfiw 172.24.1.59 /rest/scriptrunner/latest/canned/com.onresolve.scriptrunner.canned.jira.admin.EscalationService/preview [canned.jira.admin.EscalationService] Execute service: Update support request
2014-10-16 11:56:36,406 http-bio-8080-exec-15 DEBUG admin 716x8558x1 1qrhfiw 172.24.1.59 /rest/scriptrunner/latest/canned/com.onresolve.scriptrunner.canned.jira.admin.EscalationService/preview [canned.jira.admin.EscalationService] Issues returned by query (issuekey = CSD-21): [CSD-21]
2014-10-16 11:57:18,745 atlassian-scheduler-quartz1.local_Worker-1 DEBUG ServiceRunner     [canned.jira.admin.EscalationService] Checking the interval for service: Update support request at Thu Oct 16 11:57:18 CEST 2014
2014-10-16 11:57:18,745 atlassian-scheduler-quartz1.local_Worker-1 DEBUG ServiceRunner     [canned.jira.admin.EscalationService] run service Update support request: 1 elapsed
2014-10-16 11:57:18,745 atlassian-scheduler-quartz1.local_Worker-1 DEBUG ServiceRunner     [canned.jira.admin.EscalationService] Execute service: Update support request
2014-10-16 11:57:18,745 atlassian-scheduler-quartz1.local_Worker-1 DEBUG ServiceRunner     [canned.jira.admin.EscalationService] Issues returned by query (issuekey = CSD-21): []

3 answers

1 accepted

0 votes
Answer accepted
Geert Graat
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.
October 15, 2014

Ok, shoot me. Everything works just fine now. Sorry to bother you @Jamie Echlin [Adaptavist].

JamieA
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.
October 15, 2014

No worries ;-)

Geert Graat
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.
October 15, 2014

Hmmm....there is something very strange here. I changed back my original query and now I have the same problem again. I re-indexed, cleaned caches and restarted JIRA, but to no avail. 2 observations I have made analyzing the log: 1. in the log above, the EscalationService is executed by the user ServiceRunner. In my logfile a few lines further down, the user suddenly is admin (without anything changing). Since I changed my query, no user is displayed. 2. The escalation service is executed every minute. When it suddenly worked, the scheduler Worker thread changed. Especially the user seems suspicious, but I have no idea how to change that.

JamieA
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.
October 16, 2014

Seems odd - can you get your log file to me?

Geert Graat
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.
October 16, 2014

Hi Jamie, I am not able to get the log file today and next week I'm off. So I will get back to you on that.

Geert Graat
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.
October 26, 2014

Hi Jamie, it has been a while. I just reproduced the situation quickly: I first changed my query to have it return results, which it does in the preview. Then I updated the service (and the issues affected so they will be returned by the query). When the service runs normally, the query returns no results, although running the query manually does. I then changed the query to simply issuekey = <existing issue>. This works fine, both when previewed as when the service runs normally. Notice that the user changes when the service is executed. The log file is available through the link below, if you need more logging please let me know. Thanks in advance, Geert. Log file: http://we.tl/jlMrql2Tsk

Geert Graat
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.
October 27, 2014

I have tried different queries (with ScriptRunner JQL functions, without, start small, make it more complex etc.), but the results are simply non deterministic. I have seen a complex query with scriptrunner JQL function working, than I change one thing and it does not work anymore. It is really strange. Any help is greatly appreciated.

0 votes
Geert Graat
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.
October 15, 2014

JIRA 6.3.8 Script Runner 3.0.6

0 votes
JamieA
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.
October 15, 2014

What versions?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events