Behaviours plugin permission issue - Uncaught exception thrown by REST service

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 vote

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?

Hi Jamie,

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

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.

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...

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?

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Jun 14, 2018 in Jira Service Desk

How the Telegram Integration for Jira helps Sergey's team take their support efficiency to the bank

...+ reading Fantasy). The same is true for him at the bank he works for: Efficiency is key when time literally equals money. Read on to learn how Sergey makes most of the time he has by...

451 views 2 4
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