-
Bug
-
Resolution: Fixed
-
Low
-
5.4.2
-
3
-
Severity 3 - Minor
-
0
-
Issue Summary
The assets automation rule to run the groovy script executes fine manually but doesn't give expected results when run by a scheduled event.
This is reproducible on Data Center: yes
Steps to Reproduce
- Create a groovy script that runs a JQL and logs the issue details as in TestScript.groovy
Create some Jira issues that match the JQL present in the script. - Add this script to Assets Automation and run it manually. It runs fine and displays the issue details in the logs.
- Now, add the script to the scheduler and verify the log results.
Expected Results
The script runs fine when called by a scheduled event and displays the issue details in the log.
Actual Results
The script fails and throws an exception in the log during a scheduled event:
def search = searchService.search(user, query, PagerFilter.getUnlimitedFilter())
And displays the below error in the log.
2023-03-21 17:53:00,442 [insight-event-3] | AutomationRuleGroovyScriptAction, Unexpected error: Incorrect usage of JIRA/lucene search API. You can only create/use: ManagedIndexSearcher inside a context (request or Jira-Thread-Local). Check: JiraThreadLocalUtils for details. java.lang.IllegalStateException: Incorrect usage of JIRA/lucene search API. You can only create/use: ManagedIndexSearcher inside a context (request or Jira-Thread-Local). Check: JiraThreadLocalUtils for details. at com.atlassian.jira.index.ManagedIndexSearcherFactory.createFrom(ManagedIndexSearcherFactory.java:15) ~[classes/:?] at com.atlassian.jira.issue.index.ThreadLocalSearcherCache$Cache.retrieveEntitySearcher(ThreadLocalSearcherCache.java:142) ~[classes/:?] at com.atlassian.jira.issue.index.ThreadLocalSearcherCache.getSearcher(ThreadLocalSearcherCache.java:40) ~[classes/:?] at com.atlassian.jira.issue.index.DefaultIndexManager.getEntitySearcher(DefaultIndexManager.java:1014) ~[classes/:?] at com.atlassian.jira.issue.index.DefaultIndexManager.getIssueSearcher(DefaultIndexManager.java:990) ~[classes/:?] at sun.reflect.GeneratedMethodAccessor1321.invoke(Unknown Source) ~[?:?] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_311] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_311] at com.atlassian.jira.config.component.SwitchingInvocationHandler.invoke(SwitchingInvocationHandler.java:38) ~[classes/:?] at com.sun.proxy.$Proxy59.getIssueSearcher(Unknown Source) ~[?:?]
The actions from the script are not executed from a scheduled event inside a jira thread local context.
Workaround
Currently, there is no known workaround for this behavior. A workaround will be added here when available
- is resolved by
-
JSDSERVER-15279 Invalid use of RequestCache by thread: assets-replicator.Incorrect, and others
-
- Closed
-
- links to
- mentioned in
-
Page Loading...