Script listener error

Hello

 

I'm trying to set up script listener that would transition issue when story is linked but i get the following error:

2017-12-19 11:35:59,247 ERROR [runner.AbstractScriptListener]: *************************************************************************************
2017-12-19 11:35:59,248 ERROR [runner.AbstractScriptListener]: Script function failed on event: com.atlassian.jira.event.issue.link.IssueLinkCreatedEvent, script: com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.FasttrackTransition
Assertion failed:
assert issue // issue in doScript
       |
       null
    at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.FasttrackTransition.doScript(FasttrackTransition.groovy:99)

 

Any ideas?

2 answers

1 accepted

0 votes
Alexey Matveev Community Champion Dec 29, 2017

Hello,

That would be the lines which give the error in the FasttrackTransition.groovy

def issue = params['issue'] as MutableIssue

String actionId = params[FIELD_ACTION]
actionId = actionId?.replaceAll(/ .*/, "")

assert issue // issue in doScript

 I think the problem is that IssueLinkCreatedEvent does not hold the issue parameter. It holds issuelink and you can get issues only by refrencing destination and source issue objects. But the script wants the issue parameter which the event does not have. 

I believe that you can not use the event for the FasttrackTransition listener. You need to develop your custom listener.

Though I did not check my guess.

0 votes

The message means that the variable "issue" has null value in your script, i.e. it is not passed to the script.

You may want to check how (in what property?) the IssueLinkCreatedEvent carries the information about the issue.

i have used built in "fast-track transition an issue" didn't know that there are additional details that need to be defined...

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,870 views 12 18
Join discussion

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot