How to Make REST API Calls with the HTTP Client

    Note: The following applies to Zendesk, Salesforce, ServiceNow, and Azure Devops. For Jira Cloud, please see this article.

    This article shows how to do REST API calls that haven't been implemented into Exalate by making requests with the HTTP client directly in the script rules.

    Below you can find some examples of how Jira HTTP Client can be used in Exalate configuration.

    Example of using 'httpClient' in ZenDesk

    Call:

    httpClient.get("/api/v2/tickets/"+entity.id+"/"+"comments")

    Response:

    Also, we can get ContentDocument (Attachment) with the following call:

    httpClient.get("/services/data/v54.0/sobjects/ContentDocument/{id})

    Response:

    Or feedItems (Comments)

    httpClient.get("/services/data/v54.0/sobjects/"+entity.entityType+"/"+entity.id+"/"+"casecomments").records

    httpClient.get("/services/data/v54.0/sobjects/"+entity.entityType+"/"+entity.id+"/"+"casecomments").records

    Response: 

    Example of using "httpClient" in Salesforce

    In Salesforce this  can’t be done in the same way because there are some differences between JCloud REST API and SF REST API. Here, using REST API we can get all Tasks connected to a certain case.

    Call:

    httpClient.get("/services/data/v54.0/subjects/"+entity.entityType+"/"+entity.id+"/"+"tasks").records

    Response:

    Example of using 'httpClient' in ServiceNow

    Call: 

    httpClient.get("/api/now/v1/table/incident?sysparm_query=number=" + entity.key)

    Response:

    Example of using 'httpClient' in AZURE

    The following call gets information about work items.

    Call:

    httpClient.get("/" + workItem.project.getName()+"/"+"_apis/wit/workitems/"+workItem.key+"?api-version=5.1", false)

    Response: