FreshService Connector

With Flint's Freshservice Connector, we can perform operations like create, view, update and add note to a ticket.

With this document, we will be able to use and work with the Freshservice connector.

Design Aspects

Perform all standard application operations like Create Ticket, View Ticket, Update Ticket and Add Note to Ticket operations available through the freshservice connector. Some of them are listed below:

  • Allows you to perform "RESTful" operations.
  • Add note to a ticket.
  • Get details of ticket.
  • Update ticket.
  • Create ticket.

Configuring freshservice connector

add_freshservice_connector

Configuration parameters

ParameterDescriptionrequired
domain-nameName of the domain associated with your freshservice account.true
emailEmail address associated with your freshservice account.true
passwordPassword associated with your freshservice account.Optional
api-keyAPI key associated with your freshservice account.Optional
typefreshservice component on which actions will be performed like ticket, user, department, Currently, actions can only be performed on the component of type ticket.Optional

Example

{
  "domain-name": "https://test.freshservice.com",
  "email": "test@gmail.com",
  "password": "password",
  "api-key": "JrJGC4vDqQRW7Oh4bGF",
  "type":"ticket" 
} 

Actions

create

Create ticket in freshservice service desk.

Request parameters

ParameterDescriptionrequired
actionaction to perform: createtrue
subjectTicket subjecttrue
descriptionContent of ticketfalse
ticket-typeType of tickettrue
cc-emailsEmail address added in the 'cc' field of the incoming ticket emailfalse
priorityTicket prioritytrue
statusTicket statustrue
sourceTicket sourcetrue
custom-fieldsCustom field of ticketfalse
requester-idUser id of ticket requestertrue
responder-idID of the User to whom the ticket is assignedtrue
group-idId of Group to which the ticket is assignedfalse
department-idId of the associated departmentfalse

Response parameters

ParameterDescriptionrequired
resultResponse Body, Data related to tickettrue

Example

response = @call.connector("freshservice_connector_name")
                .set("action","create")
                .set("subject","Flint on localhost")
                .set("description","UI not appearing")
                .set("ticket-type","Incident")
                .set("cc-emails",["example@test.com"])
                .set("priority",4)
                .set("status",5)
                .set("source",4)
                .set("custom-fields",["task_31127:category 2"])
                .set("requester-id",216)
                .set("responder-id" , 321)
                .set("group-id",145)
                .set("department-id",795)
                .sync

ticket_content = response.get("result")  #Response Result, ticket information from freshservice.

update

Update content to ticket.

Request parameters

ParameterDescriptionrequired
actionaction to perform: createtrue
ticket-idTicket idfalse
subjectTicket subjectfalse
descriptionContent of ticketfalse
ticket-typeType of tickettrue
cc-emailsEmail address added in the 'cc' field of the incoming ticket emailfalse
priorityTicket priorityfalse
statusTicket statusfalse
sourceTicket sourcefalse
custom-fieldsCustom field of ticketfalse
requester-idUser id of ticket requestertrue
responder-idID of the User to whom the ticket is assignedfalse
group-idId of Group to which the ticket is assignedfalse
department-idId of the associated departmentfalse

Example

response = @call.connector("freshservice_connector_name")
                .set("action","update")
                .set("ticket-id",1)
                .set("subject","Flint on localhost")
                .set("description","UI not appearing")
                .set("ticket-type","Incident")
                .set("cc-emails",["example@test.com"])
                .set("priority",4)
                .set("status",5)
                .set("source",4)
                .set("custom-fields",["task_31127:category 2"])
                .set("requester-id",12345)
                .set("responder-id" , 123456)
                .set("group-id",145)
                .set("department-id",795)
                .sync

view-ticket

Retrieve and view a specific ticket.

Request parameters

ParameterDescriptionrequired
actionaction to perform: view-tickettrue
ticket-idTicket idtrue

Example

response = @call.connector("freshservice_connector_name")
                .set("action","view-ticket")
                .set("ticket-id",1)
                .sync

add-note

Add notes to a ticket - private or public

Request parameters

ParameterDescriptionrequired
actionaction to perform: add-notetrue
ticket-idTicket idtrue

Example

response = @call.connector("freshservice_connector_name")
                .set("action","add-note")
                .set("ticket-id",1)
                .set("body","Still not able to view Flint UI.")         
                .set("private",true)
                .set("to-emails",["test@gmail.com"])
                .set("user-id",12345)
                .sync
response_result = response.get("result") #Add note execution results 

Connector request error handling

Here is how you can handle the connector requests success or failures within your Flintbit. This would help you to take appropriate action if something failed.

if response.exitcode == 0               # 0 is success.
  @log.info("success")
  # take action in case of success
else                                    # non zero means fail
  @log.error("fail")
  @log.error("Reason:" + response.message)     # get the reason of failure
  ## Take action in case of failure
end

On this page: