Automatically create new service tasks for specific tickets

Modified on Sun, 9 Mar at 4:28 PM

For tickets with certain properties, you may wish to automatically create service tasks. To do so, you’ll need to access Admin Workflows → Automations → Tickets

  • Click on New Rule from the Ticket Updates tab and give your rule a name

  • Set up conditions that act as a trigger for this particular rule. 

    • When an action is performed by an "Agent" or "Agent or Requester"  

    • Select the field you want from the dropdown list for which you wish to create service tasks. This can include custom ticket properties as well. Specify the parameter to match. 

  •  Configure the actions to be executed on the ticket once the conditions you set are met. 

    • To create new service tasks, for this rule select “Trigger a Webhook” from the drop-down.

    • Ensure Request Type is POST

    • URL should be yourhelpdesk.freshdesk.com/api/v2/tickets and enter your API key in the textbox

    • Enter this code under the Content box

      {
      "parent_id" :{{ticket.id}},
      "type": "Service Task",
      "subject": "{{ticket.subject}}",
      "description": "{{ticket.description}}",
      "status": 2,
      "priority": 1,
      "email":"{{ticket.agent.email}}",
      "responder_id": "",
      "custom_fields" : {
      "cf_fsm_contact_name": "{{ticket.requester.name}}",
      "cf_fsm_phone_number": "{{ticket.requester.phone}}",
      "cf_fsm_service_location": "{{ticket.requester.address}}",
      "cf_fsm_appointment_start_time": "",
      "cf_fsm_appointment_end_time": ""
      }
      }


  • Once you’ve finished setting up all the conditions and actions, click Preview and Save.

  • Check the auto-generated summary and click on “Save and Enable” to enable this rule for your helpdesk.

Note: responder_id, appointment_start_time and appointment_end_time can be left as null


Example: For tickets from Acme Inc. or Chronus, when an agent updates the "Ticket Type" to "Dispatch Field Tech", we need to automatically create service tasks. Here's how we can set up the rule:


Image 1: Rule Name, Summary and Trigger


Image 2: Conditions and Actions

Image 3: Configuring the webhook


Note: 

  • This API request must have the parent_id parameter. Parent_id is the ID of the parent ticket to which the service task is attached.
  • It is mandatory that the value of the ‘Type’ created parameter is ‘Service Task’ in the webhook code entered.
  • A maximum of 10 service tasks can be created for a parent ticket. 
  • Please refer to our FSM API documentation for further details.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article