Behaviours plugin permission issue - Uncaught exception thrown by REST service

THOMAS SEBASTIAN July 9, 2014

Hi,

Our JIRA has been using Behaviours plugin for some time however suddenly one of the behaviours stopped working for everyone but one admin account (not the default one). The script is just a set of simple if else statements, without any condition set. The other behaviours seems to be working just fine.

JIRA log recorded this error:
2014-07-09 12:02:35,800 http-8080-3 WARN w38251 722x4371x1 1y1kezu 10.238.2.22,127.0.0.1 /secure/QuickCreateIssue!default.jspa [issue.customfields.impl.CascadingSelectCFType] Object passed 'null' is not an Option but is null
2014-07-09 12:02:36,128 http-8080-3 ERROR w38251 722x4372x1 1y1kezu 10.238.2.22,127.0.0.1 /rest/com.onresolve.jira.plugin.Behaviours/1.0/behaviours/validatorsByPid.json [common.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service
java.lang.NullPointerException
at com.atlassian.jira.issue.IssueImpl.getCustomFieldValue(IssueImpl.java:942)
at com.atlassian.jira.issue.Issue$getCustomFieldValue.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at com.onresolve.jira.groovy.Behaviour$_closure1.doCall(Behaviour.groovy:242) <+2>
at java.lang.reflect.Method.invoke(Unknown Source)
While the browser side caught this:

2 answers

0 votes
THOMAS SEBASTIAN July 10, 2014

Hi Jamie,

Thanks for responding. We are currently using v0.5.3 and our JIRA is 5.1.5

Yes that is correct we have cascading select for one of the drop down list. The thing is the script works fine but only for one admin user. Everyone else would generate the above error. So we are guessing this is some sort of permission issue but I couldn't find anything about it.

I managed to found another part of the error log. Let me start from the beginning then. Initially the error is like this:

2014-07-07 15:29:00,470 http-8080-12 WARN w38583 929x37823x1 cgcbzz 10.238.2.22,127.0.0.1 /secure/QuickCreateIssue!default.jspa [issue.customfields.impl.CascadingSelectCFType] Object passed 'null' is not an Option but is null

2014-07-07 15:29:00,705 http-8080-12 DEBUG w38583 929x37825x1 cgcbzz 10.238.2.22,127.0.0.1 /rest/com.onresolve.jira.plugin.Behaviours/1.0/behaviours/validatorsByPid.json [onresolve.jira.groovy.Behaviour] must be in role: 10011

2014-07-07 15:29:00,705 http-8080-12 DEBUG w38583 929x37825x1 cgcbzz 10.238.2.22,127.0.0.1 /rest/com.onresolve.jira.plugin.Behaviours/1.0/behaviours/validatorsByPid.json [onresolve.jira.groovy.Behaviour] user w38583:3 must be in role 10011

2014-07-07 15:29:00,705 http-8080-12 DEBUG w38583 929x37825x1 cgcbzz 10.238.2.22,127.0.0.1 /rest/com.onresolve.jira.plugin.Behaviours/1.0/behaviours/validatorsByPid.json [onresolve.jira.groovy.Behaviour] must be in role: 10011

2014-07-07 15:29:00,705 http-8080-12 DEBUG w38583 929x37825x1 cgcbzz 10.238.2.22,127.0.0.1 /rest/com.onresolve.jira.plugin.Behaviours/1.0/behaviours/validatorsByPid.json [onresolve.jira.groovy.Behaviour] user w38583:3 must be in role 10011

2014-07-07 15:29:00,705 http-8080-12 DEBUG w38583 929x37825x1 cgcbzz 10.238.2.22,127.0.0.1 /rest/com.onresolve.jira.plugin.Behaviours/1.0/behaviours/validatorsByPid.json [onresolve.jira.groovy.Behaviour] user must be reporter

2014-07-07 15:29:00,705 http-8080-12 DEBUG w38583 929x37825x1 cgcbzz 10.238.2.22,127.0.0.1 /rest/com.onresolve.jira.plugin.Behaviours/1.0/behaviours/validatorsByPid.json [onresolve.jira.groovy.Behaviour] user must be user: projectadmin

2014-07-07 15:29:00,705 http-8080-12 DEBUG w38583 929x37825x1 cgcbzz 10.238.2.22,127.0.0.1 /rest/com.onresolve.jira.plugin.Behaviours/1.0/behaviours/validatorsByPid.json [onresolve.jira.groovy.Behaviour] user must be equal to custom-field-user

2014-07-07 15:29:00,705 http-8080-12 ERROR w38583 929x37825x1 cgcbzz 10.238.2.22,127.0.0.1 /rest/com.onresolve.jira.plugin.Behaviours/1.0/behaviours/validatorsByPid.json [common.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service

java.lang.NullPointerException

-----------------------------------------

Looking at the log above I decided to try creating issue using the role 10011. However when I did that the error I posted earlier is thrown instead. Note: as I mentioned earlier the script currently only works for one account which is projectadmin.

JamieA
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.
July 15, 2014

Can you post the behaviours script that you are using?

I think this thing about the admin user might be a red herring, I can't see how this could make a difference...

THOMAS SEBASTIAN July 15, 2014

Yeah that confused us as well, but maybe it can help narrowing down the cause since at least we know that the script is actually working but just not for everyone. Or you think otherwise?

How should I send the script? Just attached it here or do you want me to send to your email?

0 votes
JamieA
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.
July 10, 2014

A stack trace is helpful, but if I knew the version of the plugin it would be much more helpful, as then I could tally the line numbers with the code.

Seems to be something to do with a cascading select. Does any of your behaviour scripts deal with cascading selects? Have options been removed or renamed recently, or the contexts changed or something?

THOMAS SEBASTIAN July 14, 2014

Hi Jamie,

When you mentioned options and contexts, what are you referring to? Sorry I'm quite new to JIRA and behaviour plugin.

Suggest an answer

Log in or Sign up to answer