Failure in Script Listeners

We are testing out the new version of Adaptavist ScriptRunner for JIRA.

We have been using ScriptRunner version 3.1.4 without issues in our Script Listeners.

During testing of the new plugin I have found 5 of our Script Listeners that have failed.

I need assistance to fix these 5 Script Listeners before I can submit to my management a purchase order for the new version of the ScriptRunner plugin.

Failure 1
*Condition*
issue.labels.any{it.label=='Transfer'} &&
(issue.isSubTask() && issue.parentObject.subTaskObjects.every { it.resolution })
*ERROR*
Static Type checking warnings found

Failure 2
*Condition*
issue.status?.name == 'Open' &&
issue.assignee?.name != null && changeItems.any {
it.get('field')=='assignee'
}
*ERROR*
Static Type checking warnings found

Failure 3
*Condition*
issue.labels.any{it.label=='NewHire'} &&
(issue.isSubTask() && issue.parentObject.subTaskObjects.every { it.resolution })
*ERROR*
Static Type checking warnings found

Failure 4
*Condition*
currentUser == "sendppomitchell"
*ERROR*
Cannot get property 'name' on null object

Failure 5
*Condition*
currentUser == "datapulljob12"
*ERROR*
Cannot get property 'name' on null object

 

JIRA Version 6.4.13
Adaptavist ScriptRunner for JIRA Version: 4.1.3.10

Failure5.pngFailure4.pngFailure1.pngFailure2.pngFailure3.png

3 answers

1 accepted

1 vote

The warnings are just warnings about deprecations - see https://scriptrunner.adaptavist.com/latest/jira/releases/UpgradingToJira7.html

I don't know what the errors are from, that's what I need the larger screenshot of.

Line-Error-3.pngLine-Error-2.pngLine-Error-1.png

Good morning,

Is there any update to the last items I posted to help resolve this issue?

In those screenshots there are just warnings of deprecated methods, I don't see anything that will prevent it working.

Can you post a screenshot of the ones with errors?

Here are the errors of the ones I can select Preview.

PreView-Issue-New-Hire.png

PreView-Issue-Transfer.pngPreView-Issue-Reporter1.pngPreView-Issue-Reporter2.png

Has these screen shots provided enough information to help create a fix?

Without having these items fixed, I cannot proceed to purchase this plugin.

I suspect Preview is not working for event listeners. It cannot generate an event. If you save that, it should work.

I have tried to save these multiple times, however everyone of these items never function properly. I am still unable to get these working with the new version of the plugin.

Perhaps it is event.user rather than currentUser, although I would expect what you have never to have worked, as currentUser was never ever a string.

I think you want:

event.user?.name == "mitchell"

 

 

I am trying to base the condition on who the report of the issue is.

I tried currentUser, event.user and issue.reporter. Neither one of these work.

ERROR 770x77510x1 15dacr8 2.8.2.8 /rest/scriptrunner-jira/latest/listeners/com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.SendCustomEmail/preview [common.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: Cannot get property 'name' on null object
java.lang.NullPointerException: Cannot get property 'name' on null object
at org.codehaus.groovy.runtime.NullObject.getProperty(NullObject.java:60)
at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:172)
at org.codehaus.groovy.runtime.callsite.NullCallSite.getProperty(NullCallSite.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:296)
at groovy.tmp.templates.GStringTemplateScript79$_getTemplate_closure1.doCall(GStringTemplateScript79.groovy:2)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)

.

I said try event.user?.name, or, issue.reporter.name

As mentioned, I think the preview functionality is not working for events.

Changing the item to issue.reporter.name == "sendppomitchell" worked for both of the Reporter listeners.

Thank you.

Any idea as to why the listeners (2) for monitoring the Closed status of Sub-tasks aren't working?

(This sends an email when all of the sub-tasks are at a closed status)

*Condition*
issue.labels.any{it.label=='NewHire'} &&
(issue.isSubTask() && issue.parentObject.subTaskObjects.every { it.resolution })

No, seems correct. I would ask a different question, you will get more views.

0 vote

For the first one, can you add a screenshot with more context please?

More-Context-Condition1.png

Here is most of the content

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

364 views 0 6
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