Skip to main content
Skip table of contents

Get customer information and deals from Hubspot into Jira issues

The need: Get customer information and associated deals from HubSpot

In this context, we use a JSM portal to manage RFP (request for proposal) requests from sales representatives on behalf of leads tracked in HubSpot.

When creating a RFP request on the Jira Service Management portal, users must select which customer they are raising the request for. This means that Jira administrators must maintain customer records and associated deals up to date in order to keep it synchronized with what’s configured in HubSpot. Furthermore, agents in charge of processing these requests - typically pre-sales teams - want to know details about the customer or any existing associated deals without having to log in to HubSpot.

We would like to:

  • populate a select list with customer stored in the CRM tool, HubSpot, and keep it synchronized

  • provide pre-sales teams with customer information stored in HubSpot (contact details, associated deals, etc.)

Solution: Populate connected items with customer names and related information

We use Elements Connect to directly fetch customer names from HubSpot by configuring a direct connection between Jira and HubSpot. We also provide Pre-sales teams with customer information stored in HubSpot, such as the customer name, e-mail, job title, and deals associated to this customer:

chrome_Q2AvX1oMlX.gif

How to configure a customer selector and fetch customer information and associated deals from HubSpot

Prerequisites

  • Have HubSpot as your Customer Relationship Management tool

  • Have Elements Connect installed on your instance

Configuration steps

The configuration is done in 4 steps:

  1. Create and configure the HubSpot datasource in Elements Connect

  2. Create and configure the Connected items in Elements Connect to retrieve customers, contacts and deals from the HubSpot datasource

  3. Associate the Connected items to a request type in your JSM project

1. Hubspot configuration

Please follow the documentation below explaining how to configure Hubspot and connect to our app: Configure Hubspot as a datasource 

2 - Configuring the connected items “Customer”, “Contacts” and “Deals”

In this tutorial, we are going to create 3 Connected items:

  • Customer: A select list that retrieves customers configured in HubSpot based on what the user is typing

  • Contacts: A read-only that displays the contact first name, last name and e-mail

  • Deals: a select list that retrieves all deals associated to the customer selected

A. Customer

Click here to expand...

Create one Connected item called “Customer” of type Select list. Set HubSpot (or the name you gave to the datasource configured previously) as the datasource and configure it as follows:

image-20240604-141016.png
  • Method: Post

  • REST Endpoint:

    CODE
    /objects/companies/search
  • Request body:

    CODE
    {
      "filterGroups":[
        {
          "filters":[
            {
              "propertyName": "name",
              "operator": "CONTAINS_TOKEN",
              "value": "*$userInput*"
            }
          ]
        }
      ],
      "sorts": [
        {
          "propertyName": "name",
          "direction": "ASCENDING"
        }
      ]
    }
  • Location of the Connected item options in the response:

    CODE
    results
  • Display template:

    CODE
    ${row.properties.name}

B. Contacts

Click here to expand...

Create a second Connected item called “Contacts” of type Read Only. Set HubSpot (or the name you gave to the datasource configured previously) as the datasource, and configure it as follows:

image-20240604-141311.png
  • Method: Post

  • REST Endpoint:

    CODE
    /objects/contacts/search
  • Request body:

    CODE
    {
      "properties" : ["firstname","lastname","email","company"],
      "filterGroups": [
          {
              "filters": [
                  {
                      "propertyName": "associations.company",
                      "operator": "EQ",
                      "value": "$issue.connected_item_XXXXX.id"
                  }
              ]
          }
      ],
      "sorts": [
        {
          "propertyName": "lastname",
          "direction": "ASCENDING"
        }
      ]
    }

    (info) Replace $issue.connected_item_XXXXX with the ID of the parent connected item (Customer)

  • Template:

    XML
    <table class="aui">
        <thead>
          <tr>
            <th id="lastname">Last Name</th>      
            <th id="firstname">First Name</th>
            <th id="e-mail">E-mail</th>
          </tr>
        </thead>
        <tbody>
          <#list data.results as contact>
            <tr>
              <td>${contact.properties.lastname}</td>        
              <td>${contact.properties.firstname}</td>
              <td><a href="mailto:${contact.properties.email}">${contact.properties.email}</a></td>
            </tr>
          </#list>
        </tbody>
    </table>

C. Deals

Click here to expand...

Create a third Connected item called “Deals” of type Read Only. Set HubSpot (or the name you gave to the datasource configured previously) as the datasource, and configure it as follows:

image-20240604-141446.png
  • Method: Post

  • REST Endpoint:

    CODE
    /objects/deals/search
  • Request body:

    CODE
    {
      "filters": [
        {
          "propertyName": "associations.company",
          "operator": "EQ",
          "value": "$issue.connected_item_XXXXX.id"
        }
      ],
      "sorts": [
        {
          "propertyName": "closedate",
          "direction": "DESCENDING"
        }
      ],
      "limit": 20
    }

    (info) Replace $issue.connected_item_XXXXX with the ID of the parent connected item (Customer)

  • Template:

    CODE
    <#-- Define the mapping for dealstage values -->
    <#assign dealstageMap = {
      "appointmentscheduled": "Appointment scheduled",
      "qualifiedtobuy": "Qualified to buy",
      "presentationscheduled": "Presentation scheduled",
      "decisionmakerboughtin": "Decision maker bought in",
      "contractsent": "Contract sent",
      "closedwon": "Closed won",
      "closedlost": "Closed lost"
    }>
    
    <#assign hubspotBaseUrl= "https://app-eu1.hubspot.com/contacts/144660773">
     
     
    <#list data.results as deal>
    <#assign closeDate = deal.properties.closedate?datetime.iso>
    <#assign formattedCloseDate = closeDate?string("MMMM d, yyyy")>
    <a href="${hubspotBaseUrl}/deal/${deal.id}/" target="_blank"><strong>${deal.properties.dealname?capitalize}</strong></a><br/>
      Amount: ${deal.properties.amount?number?string["$#,##0"]}<br/>
      Close date: ${formattedCloseDate}<br/>
      Stage: ${dealstageMap[deal.properties.dealstage]?default("Unknown Stage")}<br/>
    <hr/><br/>
    <#else>
       No deals found
    </#list>

3 - Associate the Connected items to a request type in your JSM project

Now that your connected items are configured, you need to associate them to a request-type in your JSM project:

  • Go to your project settings

  • Go to the “Connected items” section

  • Add these Connected items to the desired request-type, as below:

    image-20240604-143244.png

That's it, your use case has been set.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.