Trying to use ifwatch and JJupin SIL listener to test for field change on edit screen

Craig Leigh June 5, 2015

Here is the issue.  I have four fields on a tab on a screen in JIRA.  If any one field is updated then all four must be updated.  To test for this I choose to use the SIL listener:  issue update event.  I then call this  checkEscalation.sil script:

lfWatch("customfield_14147", {"customfield_14147", "customfield_14148","customfield_14149", "customfield_14150"}, "hook.sil", {});

Which in turns calls the hook.sil script:

if(!(( isNull(customfield_14147)  && isNull(customfield_14148) && isNull(customfield_14149) && isNull(customfield_14150) ) || (isNotNull(customfield_14147)  && isNotNull(customfield_14148) && isNotNull(customfield_14149) && isNotNull(customfield_14150) ) ) ) {
  lfShowFieldMessage("customfield_14150", "All Escalation fields must be completed if any one is entered", "ERROR");
 }

I do not get the error message, but I do get this error in the log.

 

2015-06-05 15:07:53,365 http-bio-8080-exec-25 ERROR dt84658 907x24577x1 1t9xy2a 0x.0x.0x.0x /secure/QuickEditIssue.jspa [atlassian.event.internal.AsynchronousAbleEventDispatcher] There was an exception thrown trying to dispatch event '[com.atlassian.jira.event.issue.IssueEvent@4f00f970[issue=STS-17334,comment=<null>,worklog=<null>,changelog=[GenericEntity:ChangeGroup][issue,129242][author,dt84658][created,2015-06-05 15:07:53.33][id,1826319],eventTypeId=2,sendMail=true,params={eventsource=action, baseurl=http://0x.0x.0x.0x:8080/0},subtasksUpdated=true], SingleParameterMethodListenerInvoker{method=public void com.keplerrominfo.jira.plugins.jjupin.sil.SILListener.run(com.atlassian.jira.event.issue.IssueEvent), listener=com.keplerrominfo.jira.plugins.jjupin.sil.SILListener@7e3190f}]' from the invoker 'java.lang.RuntimeException: com.keplerrominfo.jira.commons.sil.SILException: Exception while executing SIL program >>-listener-10000 on event 2 for issue STS-17334 (as: )<<'

 

What I desire is a error message to display and prevent the update until either ALL fields are completed or NO fields are completed on that screen.  

 

Any help is appreciated

 

 

1 answer

1 accepted

1 vote
Answer accepted
eric anier
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.
June 7, 2015

Hi Craig,

I would use livefields for this, i think its better to validate fields while your still on the screen.

 

Craig Leigh June 11, 2015

Thanks Eric. That works to display the message based upon the all or nothing criteria for all four fields.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events