Prerequisites
- Create a widget or dataset to filter the data needed for the Halo tickets you want to create or modify.
-
(Optional) When you need to update tickets, it is crucial to clarify the following before proceeding with the configuration:
- Determine which tickets meet the criteria for modification.
- Due to Halo supports modifications for over 200 attribute fields, please specify which parameters and attribute names you want to modify for these tickets. Please refer to REST API documentation.
- (Optional) When you need to create tickets, it is essential to clarify the following before proceeding with the configuration:
- Identify the field parameters and attribute names for the tickets you are creating. Please refer to REST API documentation.
Required Permissions
If you need to configure this guide, you need to have admin permissions.
How to Create a Bot to Create or Modify Halo Tickets
-
Log in to the MSPbots app using your Office 365 account and go to Bots.
- Click New Bot.
- In the Start From Blank tab, select Trigger.
- In the Create a new bot popup, fill in the following fields:
- Bot Name
- Role
- Tag
-
Description
- Click Continue.
- On the bot page, click Design.
- Configure the Trigger block, please refer to 2. Set up the bot trigger.
-
Go to the I want the bot to trigger when section and add the created widget as the data source.
- Go to the meets the following critieria section and configure the filtering data to filter the data further.
-
Then, in the I want the bot to run based on this schedule section, set the bot to repeat every 3 hours.
Due to the rate limit imposed by the Halo app, the ticket synchronization frequency is as follows:
If you have configured the Webhook,
- During working hours, all tickets are synchronized through Webhook, and MSPbots do not actively synchronize them.
- During non-working hours, the synchronization occurs once every 2 hours.
If you have not configured the Webhook,
- During working hours, the synchronization occurs every 5 minutes.
- During non-working hours, the synchronization occurs once every 2 hours.
Therefore, to avoid duplicate API calls, set the triggering frequency to every 3 hours.
-
- Add REST API Call block - Click Trigger block, then click the plus
button > Add a block. - Search for REST API Call in the search bar, and click that block to add it.
-
Click the ellipsis
button and select Edit to enter the REST API Call block page. -
On the REST API Call block page, fill in the following fields:
-
url - Fill in the interface address for creating or modifying tickets in Halo with the format https://{{host}}/api/Tickets.
Example: https://mspbotstest.halopsa.com/api/Tickets - integration - Select Halo from the dropdown menu. The program has already been authorized for Halo automatically, so no additional action is required.
- method - Select POST from the dropdown menu, which is the method for creating and updating tickets. For details, refer to the API documentation.
- headers - This field can be left empty.
-
params
- Click body.
- Select json.
-
Input parameter fields in the JSON body, using the following columns as an example:
[ { "actioncode":0, "dateoccurred":"2023-12-15T14:35:55.618Z", "summary":"{{job_title}}", "details":"{{user_name}}", } ]
The JSON code's syntax must adhere to the PSA's requirements. Please review these requirements before writing the code.About the example:
The "actioncode", "dateoccurred", "summary", "details", "status_id", and "tickettype_id" are from the Halo API documentation.
The {{job_title}}, {{user_name}}, and {{update_source}} are from the data you added in the widget or dataset in the Trigger block. Please note that the format of the field must be {{Field}}.
To view the field parameters:-
Locate the meets the following criteria in the Trigger block and click the Data Inspector
. -
View the fields under Row Data.
- Every data filtered by widgets will trigger one bot execution.
-
The field values enclosed in {{ }} in the JSON body will be dynamically replaced with the values of the queried data. Refer to the Halo API documentation for the input parameter fields.
Here are some commonly used attribute field explanations.
Field Description id The ID of the ticket dateoccurred The creation time of the ticket summary A brief overview of the ticket details Further information regarding the ticket status_id The ID number corresponding to the status of the ticket
For example, 1 for New and 2 for In Progress. If you want to know the ID for each status, see the section on How to view the ID for ticket status or ticket type below.
tickettype_id The ID number corresponding to the ticket type
For example, 1 for Incident and 21 for Alert. If you want to know the ID for each ticket type, see the section on How to view the ID for ticket status or ticket type below.
-
Locate the meets the following criteria in the Trigger block and click the Data Inspector
-
12. Click Finish to complete the configuration of the block.
13. After configuring, click the Save button to save the bot.
14. Click on Detail, enable the bot's runtime switch, and wait for the scheduled task to trigger. Once activated, the bot will begin creating or modifying existing tickets based on your configuration.
How to view the ID for ticket status or ticket type
Viewing the ID for ticket status and ticket type follows a similar process. The following guide provides an example of how to view the ID for the In Progress ticket status.
- Log in to the Halo app.
- Open a ticket in the Halo app.
- Press the F12 button on your keyboard or right-click and select Inspect. A pop-up window will appear at the bottom of the page.
- Click Network, then click Fetch/XHR.
- On the ticket page in the Halo app, modify the Status, for example. Change it from NEW to IN PROGRESS.
- In the window at the bottom of the page, click Tickets, then click Payload. The status_id as will be IN PROGRESS.