Online Help | Desktop App

Macro window

Use the New Macro/Macro window to configure the properties of a user macro.

On the General tab, you specify the general macro's properties:

  • Name - the macro name that appears in the User Macros category of the Select Placeholder window.

  • Placeholder - the auto-generated value based on the macro name.

  • Description - the macro description (optional).

  • Type - the macro type:

    • Text - this macro is a combination of static text and placeholders for dynamic content (object fields and other macros).

    • SQL Script - this macro is a SQL script containing Transact-SQL statements.

  • Output - the format of the macro output (applicable when the macro is used in HTML workflow components such as E-mail Notifications and HTML fields:

    • Plain Text - sets the plain text format for the macro output. Plain text messages are supported by all e-mail clients; however, you will not be able to use text formatting, bullet lists, alignment, horizontal lines, images, etc.

    • HTML - sets the HTML output format for the macro output. Select this format when you want to use text formatting, bullet lists, lines, images, etc. in your macro content. However, some e-mail clients may not support HTML e-mail.

      NOTE: Appearance of E-mail Notifications in HTML format is controlled by standard cascading style sheet (CSS) rules. For details, see Customizing E-mail Notification styles.

  • This macro available for - the macro context:

    • All objects - makes the macro global, i.e. available for all object classes.

    • Object class - makes the macro only available for the selected object class. There are two generic classes available: "All Tickets" and "All CIs".

  • Content - the macro content:

    • For Text macros - the text that is inserted at runtime. In HTML output format, you can use a standard HTML e-mail editor for text formatting, numbering, bullets, alignment, horizontal lines, images, etc. Alternatively, you can click Design > HTML Code and directly edit the HTML code.

    • For SQL Script macros - the SQL script containing Transact-SQL statements. When executed, the script will query the database and return the value of the first column from the first row of the last SELECT statement. In HTML output format, you can use HTML tags for text formatting, tables, lists, etc.

NOTE: Creating SQL Script macros requires a good knowledge of Transact-SQL. For Microsoft SQL Server, see the Transact-SQL Reference at https://docs.microsoft.com/en-us/sql/t-sql/language-reference?view=sql-server-2017.
If you are using a different version of Microsoft SQL Server, see the relevant resource at Microsoft TechNet.

TIP: You can modify user macros on the fly when configuring a workflow item or component or modifying Templates for Self Service Portal notifications. To open the Macro window, right-click the selected placeholder and choose Placeholder Definition.

  • Insert Placeholder - inserts a placeholder in your macro text or script. Clicking the button opens the Select Placeholder window, where you can choose a placeholder that will be replaced with the actual field value or macro value at runtime.

On the Usage tab, you view the workflow items and components (such as Actions, Forms, Functions, other Macros, etc.) that use this user macro as a placeholder.

  • Open - opens the selected workflow item or component.