Setting fields hidden/shown with Behaviours Plugin, not functioning?

Gianna Migliorisi February 18, 2014

I'm trying to implement this:

https://jamieechlin.atlassian.net/wiki/display/JBHV/Miscellaneous+Behaviours+Examples#MiscellaneousBehavioursExamples-Showorhidefields

in the exact scenario. We have users who abuse Blocker, so I wanted to create a justification window with a custom note if a user selects blocker.

I configued the Custom Field...and I set up the Behavior on Priority to either show or hide this field if blocker is selected, but it doesn't seem to do that...this is something I need for the Create Issue Screen. Not sure what I'm doing wrong?

10 answers

0 votes
Raj Kamal Sareen January 23, 2015

Hi Jamie,

I using behavior to hide comments. It was working fine few days back now it is not working. in fact it is not working anything now.

 

Here is xml for your reference:-

<config use-validator-plugin="false" name="Hide Comments " description="WMS_WF" guideWorkflow="WMS_WF_Jan_6_2015">
<field id="comment" required="null" readonly="null" hidden="true">
<when action="541"/>
<when action="61"/>
</field>
</config>

I enabled logging and found following error:-

2015-01-06 09:51:29,744 http-bio-9091-exec-67 ERROR RXS0VH3 591x29122x1 1fuav3m 10.252.104.57 /rest/com.onresolve.jira.plugin.Behaviours/1.0/behaviours/validators.json [common.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service
java.lang.NullPointerException  at org.codehaus.groovy.runtime.callsite.GetEffectivePojoPropertySite.acceptGetProperty(GetEffectivePojoPropertySite.java:51) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:227)
  at com.onresolve.jira.behaviours.BehaviourManagerImpl.getBehaviour(BehaviourManagerImpl.groovy:260)
  at com.onresolve.jira.behaviours.restservice.BehavioursEndpoint.getValidatorsFromIssueId(BehavioursEndpoint.groovy:44)
  at sun.reflect.GeneratedMethodAccessor817.invoke(Unknown Source) <+1>
  at java.lang.reflect.Method.invoke(Unknown Source) <+19> (DispatchProviderHelper.java:234) (DispatchProviderHelper.java:100) 

 

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.
March 12, 2014

getFormValue returns a string, it looks like an integer though. getValue() should return an actual priority object which you can call .getName() on.

0 votes
Gianna Migliorisi March 11, 2014

One other question...does the getFormValue method always return an integer? So, 1 = Blocker, 2 = Critical, etc. or do I have to modify it to match the actual String values of my priorities?

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.
March 11, 2014

I think so... but I would just paste it in to the box where you currently have it, but without the public blah() {...}

0 votes
Gianna Migliorisi March 11, 2014

oops. i missed that part of the instructions. So I can add that method to the existing ScriptSample.groovy file, yes?

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.
March 11, 2014

It should be a script not a method. Looks like you are just defining a method but nothing will call that.

0 votes
Gianna Migliorisi March 10, 2014

applied to project:

0 votes
Gianna Migliorisi March 10, 2014

behaviour settings

0 votes
Gianna Migliorisi March 10, 2014

Behaviour:

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.
March 10, 2014

Did you apply the behaviour to a project? Can you paste relevant screenshots?

Suggest an answer

Log in or Sign up to answer