how-to · watch Open this in the console

Fill a script answer from the alert.

Alerts › scripts. Restart a Windows service asks for {{service}}. There is nobody at the keyboard when the alert fires.

A required question with no typed value and no fact refuses the save. The fact still has to fit the shape.
01

The question starts empty

Open Alerts › scripts and press new trigger. Name it and choose Restart a Windows service. {{service}} appears under the script. The menu says typed value and the box is empty. The blank is required, so save refuses until it has a value or a fact. The shape is a name: letters, digits, dot, dash and underscore.

New alert script trigger with an empty typed value for the service name
Restart a Windows service is chosen. {{service}} is an empty typed value. Nothing is saved yet.
02

Type the service once

Type Spooler. That value is saved on the trigger and used on every firing. The same service restarts whichever machine matches. A space, a quote or a second command is refused, because the shape is a name.

Alert script trigger with the service name typed as Spooler
The typed value is Spooler. The menu is still typed value.
03

Or copy the hostname from the alert

Set the menu to from the alert: hostname. The box goes grey. Each firing copies that machine's hostname, and the shape is checked again before the script runs. hostname is one word, so this blank accepts it. A display name with a space is refused and the run does not start. Press save when this is the one you want. This shot stops before that. Cancel drops the draft. Run on is still these machines, and none is ticked, so a save would also need a target.

Alert script trigger copying hostname from the alert into the service blank
From the alert is hostname. The value box is grey. Save has not been pressed.

The shape of that blank is Say what a blank in a script may contain. Answering it by hand, at run time, is Answer what a script asks. A secret stays off a trigger — Keep a script answer off the record.