Null pointer exception when using lfHideAllExcept on create screen

I am running into an issue when trying to use the lfHideAllExcept function when on the create screen.  The use case is that we want to show and hide relevant fields depending on a drop down value.

I am able to show or hide fields individually but get a null pointer exception (see below) when I try to use the lfHideAllExcept function with any field.  I'm relatively new to LiveFields so I'm sure it's something simple I'm missing but can't seem to figure it out

The initial script is pretty simple but the intent is to build out a list of all fields that are relevant for each option in the RFI Type field and show or hide them as appropriate...but I can't seem to get even a basic example to work.

 

Script:

if(argv["screen"] == "create"){
    if(argv["RFI Type"] == "Casings"){
        lfHideAllExcept("RFI Title");
		//lfHide("RFI Title");
    }
    
    else{
        lfShow("RFI Title");
    }
}

 

 

Log entry:

2016-05-17 14:30:47,774 http-nio-8080-exec-15 WARN rogersc1 870x9782x1 1rz7d9u 10.74.8.145 /rest/keplerrominfo/jjupin/latest/lf/event [c.k.j.p.j.ui.livevalidator.LiveFieldRestService] Sil exception when executing script.
com.keplerrominfo.sil.lang.SILException: Exception while executing SIL program >>/data/atlassian/application-data/jira/silprograms/request_for_information/livefields/hook.sil<<
at com.keplerrominfo.jira.commons.silrunner.UnifiedSilRunner.throwAway(UnifiedSilRunner.java:234)
at com.keplerrominfo.jira.commons.silrunner.UnifiedSilRunner.interpret(UnifiedSilRunner.java:129)
at com.keplerrominfo.jira.plugins.jjupin.ui.livevalidator.LiveFieldRestService.executeHook(LiveFieldRestService.java:248)
at com.keplerrominfo.jira.plugins.jjupin.ui.livevalidator.LiveFieldRestService.executeHooks(LiveFieldRestService.java:231)
at com.keplerrominfo.jira.plugins.jjupin.ui.livevalidator.LiveFieldRestService.onEvent(LiveFieldRestService.java:160)
... 2 filtered
at java.lang.reflect.Method.invoke(Method.java:497)
... 19 filtered
at com.atlassian.plugins.rest.module.RestDelegatingServletFilter$JerseyOsgiServletContainer.doFilter(RestDelegatingServletFilter.java:178)
... 1 filtered
at com.atlassian.plugins.rest.module.RestDelegatingServletFilter.doFilter(RestDelegatingServletFilter.java:73)
... 101 filtered
at com.atlassian.plugins.rest.module.servlet.RestSeraphFilter.doFilter(RestSeraphFilter.java:40)
... 30 filtered
at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:201)
at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:178)
at net.bull.javamelody.PluginMonitoringFilter.doFilter(PluginMonitoringFilter.java:85)
at net.bull.javamelody.JiraMonitoringFilter.doFilter(JiraMonitoringFilter.java:105)
... 46 filtered
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.keplerrominfo.sil.lang.SILInfoException: [SIL Error on line: 5, column: 9] null
at com.keplerrominfo.sil.lang.SILUtils.error(SILUtils.java:146)
at com.keplerrominfo.sil.lang.SILUtils.throwAway(SILUtils.java:128)
at com.keplerrominfo.sil.lang.SILUtils.throwAway(SILUtils.java:124)
at com.keplerrominfo.sil.lang.grammar.ASTCallNode.interpret(ASTCallNode.java:76)
at com.keplerrominfo.sil.lang.grammar.SILNode.interpret(SILNode.java:141)
at com.keplerrominfo.sil.lang.grammar.SILNode.interpret(SILNode.java:141)
at com.keplerrominfo.sil.lang.grammar.ASTIfNode.interpret(ASTIfNode.java:72)
at com.keplerrominfo.sil.lang.grammar.SILNode.interpret(SILNode.java:141)
at com.keplerrominfo.sil.lang.grammar.ASTBlock.interpret(ASTBlock.java:27)
at com.keplerrominfo.sil.lang.grammar.SILNode.interpret(SILNode.java:141)
at com.keplerrominfo.sil.lang.grammar.ASTIfNode.interpret(ASTIfNode.java:72)
at com.keplerrominfo.sil.lang.grammar.SILNode.interpret(SILNode.java:141)
at com.keplerrominfo.sil.lang.grammar.ASTParseNode.interpret(ASTParseNode.java:37)
at com.keplerrominfo.sil.lang.executors.CachedInterpreterExecutor.directInterpret(CachedInterpreterExecutor.java:86)
at com.keplerrominfo.sil.lang.executors.CachedInterpreterExecutor.interpret(CachedInterpreterExecutor.java:79)
at com.keplerrominfo.sil.lang.SILInterpreter.interpret(SILInterpreter.java:100)
at com.keplerrominfo.jira.commons.ivm.IssueSILInterpreter.interpret(IssueSILInterpreter.java:151)
at com.keplerrominfo.jira.commons.silrunner.UnifiedSilRunner.interpret(UnifiedSilRunner.java:120)
... 214 more
Caused by: java.lang.NullPointerException
at com.keplerrominfo.jira.plugins.jjupin.livevalidator.routines.LiveFieldHideAllExceptRoutine.executeRoutine(LiveFieldHideAllExceptRoutine.java:69)
at com.keplerrominfo.sil.lang.AbstractRoutine.execute(AbstractRoutine.java:78)
at com.keplerrominfo.sil.lang.grammar.ASTCallNode.interpret(ASTCallNode.java:72)
... 229 more

2 answers

1 accepted

This widget could not be displayed.

We fixed this in the latest version of JJUPIN (released). Do an update.

 

As always, have fun,

Radu

Thanks Radu, I can confirm this is working in 3.1.6

This widget could not be displayed.

Hi,

you have probably error in the field name lfHideAllExcept("RFI Title");

check it. If you are sure that this is correct please use id of this custom field istead of name. It will work for sure. Any problem? let me know

Hi Michal,

Thank you for the quick response!  Unfortunately the results are the same regardless of whether I use the name of the field or the ID (and I get the same results if I use a JIRA default field like summary or description)

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 22, 2018 in Marketplace Apps

How a Marketplace app tech team is achieving gender diversity

Hello! My name is Genevieve Blanch, and I'm the Marketing Manager at RefinedWiki, creators of apps to give teams the tools to customize Atlassian platforms. Currently, 44% of the tech team at Re...

523 views 3 19
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