Forums

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

Why does the same Groovy script work differently?

Alexey Gusev
Contributor
August 29, 2022

Hello everyone!

I have a Groovy script, which if run from the console, it works fine, but if you put the same script as a file on the server and run the script from the file, the result is different.

Script

package example

import com.riadalabs.jira.plugins.insight.channel.external.api.facade.IQLFacade
import com.onresolve.scriptrunner.runner.customisers.WithPlugin
import com.onresolve.scriptrunner.runner.customisers.PluginModule


@WithPlugin(value = "com.riadalabs.jira.plugins.insight")

@PluginModule IQLFacade iqlFacade

iqlFacade.findObjects("objectType = Сотрудник")


Starting from the console

Image 1.png

Running as a script file

Image 2.png

Why is this happening?

Jira Service Management Version: 4.20.2

Version of the ScriptRunner plugin: 6.57.0

1 answer

1 accepted

0 votes
Answer accepted
Benjamin
Community Champion
August 29, 2022

Hi @Alexey Gusev,

 

Should be the same. Could be a bug. Would recommend contacting ScriptRunner support:

 

https://productsupport.adaptavist.com/servicedesk/customer/portal/2/user/login?destination=portal%2F2

 

-Ben 

Alexey Gusev
Contributor
August 30, 2022

Hi @Benjamin 

Yes, it looks like a mistake.

Thanks for the advice, I'll try to write

Like Benjamin likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events