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

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

This widget could not be displayed.

Hi Craig,

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

 

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
Community showcase
Posted yesterday in United States

Local Atlassian Research Workshop opportunity on Sep. 28th

We're looking for participants for another workshop at Atlassian! We need Jira admins who have interesting custom workflows, issue views, or boards. Think you have a story to sh...

13 views 0 0
View post

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