Jira Cloud Scriptrunner - Hello World

JosephF November 16, 2016

I just installed ScriptRunner and am trying to get a very basic Hello World script to run.  Failing miserably...

 

I installed the add-on and copied the sample code for Email Notify on Priority Change.

import groovy.xml.MarkupBuilder

def priorityChange = get(issue.self) 
    .queryString('expand', 'changelog')
    .asObject(Map)
    .body
    .changelog
    .histories
    .last()
    .items
    .find { it['field'] == 'priority' }
.
.
.

This fails right out of the chute because it complains that  

[static type checking] - the variable [issue] is undeclared

.

I must be missing something basic here.  Any thoughts?

2 answers

4 votes
Jon Mort [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 16, 2016

Hi Joseph,

The static type checking is only advisory. It is something we are working on to improve the accuracy of. The script you have there should run just fine when the event fires.

Regards, Jon

0 votes
JosephF November 16, 2016

Capture.PNG

Suggest an answer

Log in or Sign up to answer