Event Handler Execution Logs

Every event handler execution - whether it succeeds, fails, or times out - is recorded in the activity logs. This gives you full visibility into what your automation is doing.

Accessing Logs

  1. Navigate to Apps → ScriptForge → Activity Log
  2. Filter by Feature: Event Handlers to see only event handler logs
  3. Click any entry to see full details

Log Entry Contents

Each log entry includes:

Field Description
Event Handler Name Which event handler fired
Event The event that triggered it (e.g., avi:jira:created:issue)
Timestamp When execution started
Duration Execution time in milliseconds
Status Success, Error, or Timeout
Console Output All console.log, console.warn, console.error statements
Return Value The value returned by the script (if any)
Error Details Error message and stack trace (if execution failed)
Context Issue key, project, user who triggered the event

Filtering and Searching

  • By status: Show only errors to identify problems
  • By event handler: Show executions for a specific event handler
  • By date: Narrow to a time window
  • By text: Search within output or error messages

Troubleshooting with Logs

Script Not Firing

If an event handler isn't executing:

  1. Check the logs - if there is no entry at all, the condition may be failing
  2. Verify the event handler is enabled
  3. Confirm the event type matches what's happening
  4. Check the project filter - it might be scoped to a different project

Script Failing

If the log shows "Error":

  1. Read the error message and stack trace
  2. Common issues: calling methods on undefined (event data shape may differ from expected), timeout for large JQL queries, permissions errors when using runAs: 'user'

Script Running But No Effect

If the log shows "Success" but nothing happened:

  1. Check the console output - did your conditions inside the script evaluate as expected?
  2. Add console.log statements to trace the execution path
  3. Verify the Canarys HAPI calls are awaited - forgetting await on async operations means they may not complete before the script ends

Loop Detection Logs

If ScriptForge detects a potential infinite loop (an event handler triggering events that trigger the same event handler), the log entry shows a loop detection warning and the execution is halted. Review the chain of events to break the cycle - typically by adding a condition that prevents re-triggering.