It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Call method from groovy script in workflow function condition Edited


As I am trying to be a good developer, I am putting all my groovy code in custom scripts in the scripts-folder and call the method I need from ScriptRunner.


Inside my scripts/ - folder is a file test.groovy with following content:

class CheckUtil {
public static boolean check(field) {
/* some 50 lines, complex, multiple times needed method */
/* ... */
return field.value == "42" // for simplicity

Then, I want to use the "Set security level"-post function in my workflow, to set specific security levels based on custom fields. Therefore, I must specify some conditions like "if customfieldvalue is 42, then set security level to 42" or something.

As my conditions are inside the test.groovy and I do not want spreaded/duplicated code, I simply want to call:


No errors were found, the compiler-indicator is green. But sadly, when the condition is executed, I get:

Condition failed on issue: TEST-27, built-in script:com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.SetIssueSecurity
groovy.lang.MissingPropertyException: No such property: CheckUtil for class: Script165

So, my questions are:

  • How can I call methods from my scripts inside the scripts/-folder?
  • Why is the compiler-indicator green?

Thanks a lot for any help!


1 answer

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published Apr 03, 2019 in Marketplace Apps

How to estimate projects more accurately?

Gaining insight into your team’s effectiveness and choosing the right estimation technique.   Estimating projects is hard. It is because people have the tendency to underestimate the time thin...

290 views 2 9
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