IF-ELSE-STEP Service Desk CommandsThe following is a summary of IF-ELSE and STEP statements used in Service Desk procedures.
Where Used These IF-ELSE and STEP statements are used by the following types of Service Desk procedures.
IF-ELSE in Detail Check a Variable Enter the name of the variable in the format Enter a string comparison operator. The same string comparison options are available for all IF commands. See String Comparisons and Date/Time Comparisons. Then enter a second value to compare against the first value. Instead of a value you can also enter a property variable in the format If the test is true, IF steps are executed. If the test is false, ELSE steps are executed. Is Within Coverage This IF command is not available for Ticket Request De-Dup and Ticket Request Mapping procedures. Tests whether a ticket or KB article is currently within the coverage schedule. Tests for Duplicate Requests This IF command is only available in a Ticket Request De-Dup procedure. Tests a ticket request to see if it is a duplicate of any existing ticket. Prevents multiple tickets from being created for the ticket request, within a specified time limit. Ticket requests are created from either inbound emails or system events, such as alarm conditions. Incoming Email and Alarm Settings and linked service desk procedures determine how ticket requests are processed into tickets, what service desks are used to create the tickets, and whether ticket requests are canceled. Tests true if one or more of the following conditions are matched:
Test a Custom Field of the Ticket Enter the name of the custom field in the format Enter a string comparison operator. The same string comparison options are available for all IF commands. See String Comparisons and Date/Time Comparisons. Then enter a second value to compare against the first value. Instead of a value you can also enter a property variable in the format If the test is true, IF steps are executed. If the test is false, ELSE steps are executed. Test a Property Value of the New Ticket Select a ticket property from the drop-down list. Enter a string comparison operator. The same string comparison options are available for all IF commands. See String Comparisons and Date/Time Comparisons. Then enter a second value to compare against the first value. Instead of a value you can also enter a property variable in the format If the check is true, IF steps are executed. If the check is false, ELSE steps are executed. Test Property Value of the Receipt This IF command is only available in a Ticket Request Mapping procedure. Select a ticket property from the drop-down list, in the format Enter a string comparison operator. The same string comparison options are available for all IF commands. See String Comparisons and Date/Time Comparisons. Then enter a second value to compare against the first value. Instead of a value you can also enter a property variable in the format If the test is true, IF steps are executed. If the test is false, ELSE steps are executed. SourceType, SourceTag and SourceValue Properties The
All Alerts The following fields are set for all tickets generated from all alerts:
Event Log Alert Note: Only the Event Log, Missing Event Log, and Multiple Event Log alerts (SourceType) have more than two SourceTag fields. The following fields are set for all tickets generated for the specified event log alert. 3, 4 and 5 sourceTags and sourceValues are generated for Missing Event Log Alerts and Multiple Event Log Alerts.
LogType Values from the eventLogType Table
String Comparisons The string comparisons performed in IF commands are not case sensitive. The available tests are:
For the tests Date/Time Comparisons You can use an IF statement to test whether a time relative to the current time is true or not. Relative time is specified as STEP in Detail Add a Note Adds a note to the ticket being processed by the procedure. You choose to make the note hidden or not. Select a note template instead of entering a note. Note text can include an property variable in the format Assign Object Property Assigns a value to the property of a new ticket created in a previous service procedure step using the Create Ticket command.
The set of properties that can be assigned are displayed in a drop-down list. See Working with Variables for more information about variables. Note: Use Assign Ticket Property to assign a value to the property of the current ticket. Assign Ticket Custom Field Assigns a value to a custom field in a ticket. Enter the name of the custom field in the format You can also enter a property variable in the format Assign Ticket Property Assigns a value to the property of the current ticket. The set of properties that can be assigned are displayed in a drop-down list. The supplied value may be a global variable name or procedure variable name in the format Note: Use Assign Object Property to assign a value to the property of a new ticket created using the Create Ticket command. Create Ticket Creates a new ticket in a specified service desk.
Events occur in the following order:
Delete a Ticket Deletes the ticket being processed by the procedure. Execute a Common Sub-Procedure Causes a sub-procedure to execute. Use this capability to string multiple IF-ELSE clauses together. You can nest the execution of procedures to 10 levels. Execute an External Script Executes a script written in C#. This command only displays when KSD 1.3 is installed in VSA 6.2 or later. The VBScript and JScript options are not yet implemented. See the Execute an External Script community page for details. executeShellCommand() Executes a shell command on the Kaseya Server. Runs from the Execute SQL Non-Query Executes an SQL non-query command on the Kaseya Server SQL Server database. This option only displays for master role users. Warning: Direct manipulation of the Kaseya Server database can result in a massive loss of data. For example executing the Execute SQL Non-Query command
Execute SQL Select Query Executes an SQL select query command on the Kaseya Server SQL Server database. This option only displays for master role users. For example, the Execute SQL Select Query command
Fails the Current Ticket Transaction If included in a procedure, cancels all changes to the ticket. Cancels both ticket changes made manually before saving the ticket and ticket changes made within the procedure being processed prior to this step being run. Does not cancel sendEmail() or sendMessage() steps processed before this step is run. Cancels all steps in the procedure after this step is run. Get Agent Property Returns a selected property value from the last audit of the agent machine associated with the ticket.
Get a Variable Defines a new procedure variable and assigns it a value. Specify the variable name without brackets. Example: You can refer to this variable in text fields in any subsequent steps by adding
Link to Another Ticket Links the ticket being processed to a specified ticket ID or knowledge base article ID. Pause Stage Goal Pauses counting elapsed time against the current stage goal. Goal procedures are linked to stages using the Service Desk > Desk Definition > Processing > Stage > Procedures tab. Pause Ticket Goal Pauses counting elapsed time against the ticket goal. The ticket goal determines the due date for the entire ticket. Goals are linked to a service desk using the Desk Definition > Properties > General > Procedures tab. Resume Stage Goal Resumes counting elapsed time against the current stage goal. Goal procedures are linked to stages using the Service Desk > Desk Definition > Processing > Stage > Procedures tab. Resume Ticket Goal Resumes counting elapsed time against the ticket goal. The ticket goal determines the due date for the entire ticket. Goals are linked to a service desk using the Desk Definition > Properties > General > Procedures tab. scheduleProcedure() Runs a selected agent procedure for a specified machine. Use sendEmail() Sends an email to one or more recipients. Specifies the subject and body text of the email. Optionally check the Send the email if the body contains the [$ChangesAsHtml$] or [$Changes$] and those properties are empty due to hidden notes. This prevents emails with "empty" notes from being sent. You can include property variables, global variables and procedure variables in the To, From, Subject, and Body fields of a sendEmail() command. You can reference property variables, global variables and procedure variables in the message templates you link to in a sendEmail() command. See Standard and Custom Property Variables for a list of property variables. See Procedure Variables and Working with Variables for more information about variables. You can also enter the name of a pool of users. Names are delimited using commas or semi-colons. The following order of precedence determines the email addresses of recipients. The name in the To field of a sendEmail() step is checked to see if it:
sendMessage() Sends a message to the Inbox of a user. You can only enter one user name in the To field of the sendMessage() dialog box. Use sendMessage() to User Pool to send a message to multiple users. You can include property variables, global variables and procedure variables in the To, From, Subject, and Body fields of a sendMessage() command. You can reference property variables, global variables and procedure variables in the message templates you link to in a sendMessage() command. See Standard and Custom Property Variables for a list of property variables. See Procedure Variables and Working with Variables for more information about variables. Sends a text message to a mobile device. Not yet implemented. Converts a text message to a voice message and sends it to a mobile device. Not yet implemented. Send Message to Pool Users Sends a message to the Inbox of all users in a selected pool. You can include property variables, global variables and procedure variables in the Subject, and Body fields of a Send Message to Pool Users command. You can reference property variables, global variables and procedure variables in the message templates you link to in a Send Message to User Pool command. See Standard and Custom Property Variables for a list of property variables. See Procedure Variables and Working with Variables for more information about variables. Set Escalation Time Sets the time a ticket is escalated. Overrides the default escalation time set for a stage using the Service Desk > Desk Definition > Processing > Stage > Procedures tab. The escalation time can be calculated using the coverage schedule associated with the ticket or using calendar time. For example, if a coverage schedule does not include weekend coverage, and the ticket escalation procedure runs during the weekend, escalation of the ticket will not start counting until coverage begins on Monday morning. If escalation time is calculated using:
Set Goal Time Sets the time the goal for a stage is scheduled to be completed. Overrides the default goal time set for a stage using the Service Desk > Desk Definition > Processing > Stage > Procedures tab. Set Ticket Goal Time Sets the time the goal for a ticket is scheduled to be completed. The ticket goal determines the due date for the entire ticket. Overrides the default goal time set for a ticket using the Desk Definition > New or Edit > Procedures tab. writeProcedureLogEntry() Writes the supplied string to System > Application Logging. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Topic 4009: Send Feedback. Download a PDF of this online book from the first topic in the table of contents. Print this topic. |