unable to resolve class com.atlassian.greenhopper.api.events.sprint.SprintEvent

nick.rozhdestvensky March 12, 2019

Hi all!

I have a scriptrunner custom listener. The goal - to catch "sprint started" event.

But I can't import:

import com.atlassian.greenhopper.api.events.sprint.SprintEvent
...
...
SprintEvent event = event as SprintEvent
Sprint sprint = event.sprint
...

because of an error:

unable to resolve class com.atlassian.greenhopper.api.events.sprint.SprintEvent

 

How can I resolve it?

Thanks!

 

ScriptRunner 5.5.0.

With SR 5.4.45 script worked fine.

 

1 answer

1 accepted

0 votes
Answer accepted
Marc Minten _EVS_
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.
March 12, 2019

I think it is not related to your version of scriptrunner. We are on 5.3.26 and when I add the import line to my Sprint Listener script I get the same error.

I did not found a decent way to cast the event to a proper SprintEvent, so I use in my Sprint Listener:

import com.atlassian.greenhopper.service.sprint.Sprint

def sprint = event.sprint as Sprint

and this works (it returns a static type checking "error" complaining that an issueEvent does not have a property sprint, but I ignore that "error" message).

The API interface to the former greenhopper part (Agile) remains a dark undocumented area :-(

nick.rozhdestvensky March 13, 2019

Thanks, Marc! It works!

I also wrote to Adaptivist. Hope, they will update documentation.

Marc Minten _EVS_
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.
March 13, 2019

Ji Nick, great!

I think it is not a problem of Adaptavist; my code comes from their examples (https://scriptrunner.adaptavist.com/latest/jira/listeners.html#_jira_software_events).

But Atlassian should have a decent documentation of the (former greenhopper) REST API and developers API. It is missing for many years already :-(

Suggest an answer

Log in or Sign up to answer