Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,361,803
Community Members
 
Community Events
168
Community Groups

Why does the same Groovy script work differently?

Edited

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 Leader Aug 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 

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
Community showcase
Published in Jira Service Management

An unofficial way to monitor a JSM mail handler for errors

...eturns true if any content is returned for the webResponse.body.data.first s...

718 views 3 20
Read article

Atlassian Community Events