An Outbound Integration with ConnectWise Manage allows AlertOps users to create, or close, tickets in ConnectWise from alerts in AlertOps.  

It can be used in conjunction with a ConnectWise Manage Inbound Integration to close tickets in ConnectWise from alerts that were themselves generated when a ticket was created in ConnectWise.  Please note such a configuration must be a closed loop; ticket creation should be initiated either in AlertOps or ConnectWise exclusively. 

The following elements are necessary to configure an Outbound Integration with ConnectWise Manage.  In most case, these will need to be generated specifically for this Integration, and we'll describe how to produce them:

  • An API Member in ConnectWise
  • Public/Private keys associated with the API Member
  • Your ConnectWise CompanyID (needed to produce the REST API Key)
  • A ClientID in ConnectWise
  • A Custom Alert Field in AlertOps to contain the TicketID

We will begin in AlertOps, by building the Outbound Integration which will require the above elements from ConnectWise, so you will see where we will apply those keys before we generate them.

Before we create the Outbound Integration, we will need the Custom Alert Field that will contain the Ticket ID that Connectwise will provide.  From the Administration menu, select Custom Alert Fields.

Select or add the appropriate Alert Type.  In most cases, adding the field to the Standard Alert Type is sufficient, as it will then be present in all alerts.  Select the Standard Alert Type.  Then press Add Alert Fields.

Name your Custom Alert Field and choose Short String as the Data Type.  Save.  This will present your Custom Field as a Keyword in the Outbound Integration.

Next, we will create the Outbound Integration.  Select Outbound Integrations from the Integrations menu.  Press Add Outbound Integration.

Provide a name for the Integration, choose None for Web Security Type, leave the other fields blank, and Save.

With the shell of the Integration in place, a Method must be configured for each interaction with ConnectWise.  We will configure two Methods, one to Open a Ticket, and one to Close a Ticket.  You may add further Methods for more granular actions (Create P1 Ticket, Create P2 Ticket, etc).  

In the lower section, press Add Method.

In the Method Detail page configure the fields as follows (most are default):
Enter a unique name for the Method
Set the Type as REST
Set the Alert Type as the Type in which you created the Custom Field (Standard Alert)
For the URI, use the following format:
   https://yourconnectwiseurl.com/version/apis/3.0/service/tickets
   example: https://staging.connectwisedev.com/v2019_5/apis/3.0/service/tickets
Set the Request Type as JSON
Set the Web Method as POST
Set the Response Data Type as JSON
Select the Update Alert Fields checkbox

Below, in the Request Data section, enter the following JSON:

{
"summary":"<<Message.MessageText>>",
"company": {
            "id": 4},
"priority":{"id":1},
"source":{"name":"AlertOps API"}
}


The JSON provided can be modified to suit your organization's needs, but the examples used will produce the base functionality needed.

In the Response Data section, enter the following JSON:


{
    "id": "<<Attribute.Ticket ID>>"
}


Please note, the keyword (denoted by <<Attribute.xxx >>) used in the Response Data is the Custom Field you created earlier, available from the list on the left.  

Last, we will add two Headers below.  We will populate these with items from ConnectWise, described in the following sections of this article.

In the Headers section, press the + symbol to add a new Header.  Add one Header called Authorization, and another called ClientID.

Press Save.  We will now move to ConnectWise Manage to set up that system.

In ConnectWise Manage, we will create an API Member, and generate public/private keys for that Member. We will use those keys to generate an API key for our Authentication Header. We will then use a ClientID for our ClientID Header. E-mail AlertOps support@alertops.com to retrieve the ClientID.

From the System menu, select Members.

From the Members page, select the API Members tab

Add a new Member by pressing the + button.  Provide a MemberID, and a Member Name.  Populate the other required fields, but make sure the Business Unit contains the board you want to post to.  Save.

Once saved, additional tabs become available.  Select the API Keys tab.

Press the + to add a new set of keys.

Add a description and press save.  The fields for Public and Private Keys will be populated with your keys.  As noted, copy these out for reference, as the Private Key will no longer be visible once you leave the page.

Next, we must create our header.  Refer to the ConnectWise Authentication document here (login required).  We will be using Member Authentication.  To produce the header, we follow this format:

Method 1 - API Keys - Member Authentication
It is recommended to create API Members versus using API Keys tied to a specific member.
Authorization: Basic base64(companyid+publickey:privatekey)
(Authorization: Basic Y29tcGFueWlkK3B1YmxpY2tleTpwcml2YXRla2V5)

For the next step, there are a number of free web sites which can provide the necessary base 64 encoding. 

https://www.base64encode.net/

Use the described format explicitly, including the "+" and ":"

companyid+publickey:privatekey

You can find your companyid on your login page for ConnectWise Manage

Once you encode the keys, the result will look similar to this:

Y29tcGFueWlkK3B1YmxpY2tleTpwcml2YXRla2V5

What we will enter into the Header in AlertOps will be as follows:

Basic Y29tcGFueWlkK3B1YmxpY2tleTpwcml2YXRla2V5

Now, we need to use the ClientID for our other Header. To retrieve the AlertOps ClientID, e-mail AlertOps support at support@alertops.com.

Save the Method.

Next, we will create the Close Ticket Method.  Fortunately, we will reuse the Headers from the Create Ticket Method, so this will be much simpler.

From the ConnectWise Manage Outbound Integration, press Add Method.  Name the Method, and configure the fields as follows:
Set Type as REST
Set AlertType as Standard (or whichever Alert Type you added the Ticket ID field to)
Set the URI using the following format:
   https://yourconnectwiseurl.com/version/apis/3.0/service/tickets/<<Attribute.CustomField>>
   example: https://staging.connectwisedev.com/v2019_5/apis/3.0/service/tickets/<<Attribute.Ticket ID>>
The URI must have the Custom Field for the Ticket ID at the end to indentify which ticket we are closing

Set the Request Type as JSON
Set the Web Method as Patch
Set the Response Data Type as JSON
Leave the Update Alert Fields unselected
For the Request Data, use the following:

[
  {
    "op": "replace",
    "path": "status",
    "value": {
            "name": "Closed (resolved) replace with your closed status"
    }
  }
]

Be aware the PATCH operation for ConnectWise Manage requires the specific syntax above, including the different brackets.  Ensure that the "name" field contains the exact name of the Closed status for your board.

Below, provide the same headers we configured for the Create Ticket Method.

Save the Method.

To apply these Methods automatically, you should use Workflows to trigger them.  Learn about Workflows here.

To apply these Methods manually, consider using Outbound Actions.

Did this answer your question?