Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info
titleAvailability

This routine is available starting with 

  • Power Scripts 2.5 (server)
  • SIL Engine™ (former katl-commons ) 2.5

Syntax

lfWatch(field, relatedFields, scriptPath[,javaScriptEvents]);

...

Excerpt
Attaches listeners for the events that you give as parameters in the function.

If you don’t specify give any eventsevent, this routine attaches listeners to the “change” event which is triggered when the issue is updated. Every time when the event is triggered, the SIL script from scriptPath parameter runs. This SIL script receives the values for the relatedFields parameter and you can use them as: argv["field"].

Parameters

ParameterTypeRequiredDescription
fieldStringYesField to listen to
relatedFields

Array

String

YesDependent fields required for the given field (needed only if you get the field's values from the screen like this: argv["field"])
scriptPathStringYesScript source to run when the event is triggered
javaScriptEventsArrayNoEvents to listen to. It's any JavaScript event (check this list for example).Starting with SIL Engine v 4.1.1, you can also listen to the following Jira events: inlineEditSaveComplete, newContentAdded, issueRefreshed which refer to the inline editing on the view issue screen Jira UI events.

 

Warning
title"change" event

When using the "change" event on a "labels type" field (fixVersions, Affected Versions, Labels, Components, etc.), the event will never trigger when a label is deleted, but only when labels are added. We have noticed that for these fields the "focusing" event closely matches the behavior expected for the "change" event.

...