The Adaptavist Group LogoDocumentation

2.1 Video: Groovy Basics for ScriptRunner Data Center

Watch a Groovy programming language fundamentals video covering what you need to write ScriptRunner scripts.

Note: For more information on scripting, check out the HAPI documentation and our Best Practices section.

The script in the video above can be simplified with HAPI. For example, using HAPI, the script to return the value of a custom field in an issue is as follows:

def issue = Issues.getByKey('GAV-15')

issue.getCustomFieldValue('Reason for QA Fail')

def value = issue.getCustomFieldValue('Reason for QA Fail')

if (value) {
    return value
}
else {
    return "There is no value in this field on the chosen issue"
}

See the HAPI documentation for more information on reading custom fields.

Search documentation

Start typing to search the docs.