Script Runner -- problem with a scripted condtion

Steven December 1, 2012

So I wrote a scripted condition to prohibit a particular workflow transition if the assignee has not commented on it. ( I check for a particular value in a custom field, and if the test is true, I look at the list of comments and check that the getAuthor of the last one equals the issue.Assignee.)

It works well enough, but the problem is, when the transition is prohibited, of course, you don't see it in the list. So, if you go to open the Conditions Validator to see why the transition doesn't show, then the system throws a NullPointer exception, because there is no getHtml method to fill it in.

Here is the actual message that comes back:

Error rendering WebPanel (viewissue/activityblock.vm): org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getHtml' in class com.intenso.jira.plugins.condval.issuetabpanel.ConditionsValidatorAction threw exception java.lang.NullPointerException at viewissue/activityblock.vm[line 50, column 23]

So we need this method for Jira to call, and some way to fill it in with the relevant stuff for the Conditions Validator. Is that already in the package and I missed it?

Steven

1 answer

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.
December 1, 2012

What version of script runner are you using... I fixed a problem where it was not working with the Intenso conditions validator some time back.

Steven December 1, 2012

It's 2.0.7....

Steven December 1, 2012

Happens that the Conditions Validator is 1.3.2; there is a 2.0.5 available for that. I will try upgrading and see what happens.

Our Jira instance is 5.0.7 right now, but we will shortly upgrade that as well.

Steven December 1, 2012

OK, more information: I upgraded the Intenso conditions validator to version 2.0.5, same as what we have in the production instance, and the problem still appears anytime you open the conditions validator in the step where this scripted condition appears. Doesn't matter if the script is returning "true" or "false" either, of course.

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.
December 2, 2012

Can you post the full stack trace.

Steven December 2, 2012

(trace.txt) Here ya go....

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.
December 2, 2012

I'll take a look at it when I can.

Steven December 2, 2012

We don't have any place on the Scripted Condition field to add a text description of what the condition is. Apparently Conditions Validator expects getHtml() to return such a description for use in its own display of passes and fails.

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.
December 2, 2012

No, you can't enter it, but the plugin provides one. It's what you see when looking at the conditions in the workflow editor, text mode. The problem is the NPE... not sure why it's caused, will look in to it.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events