In this brief blog, we'll throw a warning dialog in an Automation Script. We'll be using python.
The script necessary to throw the warning will take the following form:
warngroup = "warning_group"
warnkey = "warning_key"
If there are parameters in the message, you can create a string array with the necessary substitutions, e.g.:
warnparams = [string1, string2, etc.]
If it's an error dialog you want then use errorgroup, errorkey and params.
As an example, let's make a simple SR object automation script with the following code snippet:
if mbo.getString('ticketid') == "TEST":
warngroup = "mygroup"
warnkey = "mykey"
warnparams = ["dog","cat"]