Description
Attaches listeners for the events that you give as parameters in the function. If you don't give any event, 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
Return Type
None
Example
For the scriptPath parameter you can either give the relative path (as in the example above), or the absolute path:
C:/Program Files/Atlassian/Application Data/JIRA/silprograms/hook.sil.
lfWatch("summary", {"summary", "customfield_13706","components"}, " hook.sil", {"keyup"}); //where field = "summary";relatedFields = {"summary", "customfield_13706","components"};scriptPath = " hook.sil";javaScriptEvents = {"keyup"}
Every time when the keyup event is triggered, the hook.sil is executed. When the Summary field contains the word ?important?, the Priority field is set to "Highest" and a message is displayed for the priority fie
//hook.sil : if (contains(argv["summary"], "important")) { lfSet("priority", "Highest"); lfShowFieldMessage("priority", "Priority changed", "INFO"); }
See also