Create a task on a policy or application

In an agent portal, you can create a task on a policy or an application. When you create a tasks on a policy or an application, the task becomes a workflow item for the policy or application and it can be sent to a user's Inbox.

The steps to creating a task on a policy or an application are similar. Creating a task includes the following steps:
  1. Identify the task template.
  2. Create the task.

Identify the applicable task templates

To identify the applicable task templates, the agent decides which policy or application requires the task. Then, the agent portal calls an API to determine the list of applicable templates. Once the agent selects one of the templates, the agent portal must note the template ID as it is required to create the task.


Process to identify the task template ID.

For example, the following steps may occur:
  1. View the application or policy details:
    Viewing a policy
    1. The portal submits the following API call:
      GET /policies/systemid
    2. The portal displays the policy details provided in the response.
    Viewing an application
    1. The portal submits the following API call:
      GET /applications/systemid
    2. The portal displays the policy details provided in the response.
  2. View the list of available tasks:
    1. The portal submits the following API call:
      GET /taskTemplates?container=containerType&containerRef=containerSystemID

      For example: GET /taskTemplates?container=Policy&containerRef=121

    2. The portal provides the agent a list of available task templates based on the API response and the agent selects one.
    3. From the API response, the portal notes the id of the task the agent want to create.
      For example:
      {
        "taskTemplateListItems": [
          {
            "id": "PolicyTask0001",
            "name": "General Reminder",
            "taskTypeCd": "Manual",
            "_links": [
              {
                "rel": "self",
                "href": "https://hostname/coreapi/v5/taskTemplates/PolicyTask0001?container=Policy&containerRef=121"
              }
            ]
          },
          {
            "id": "PolicyTask0002",
            "name": "General Task",
            "taskTypeCd": "Manual",
            "_links": [
              {
                "rel": "self",
                "href": "https://hostname/coreapi/v5/taskTemplates/PolicyTask0002?container=Policy&containerRef=121"
              }
            ]
          },
          ...

Create a task

The API to create a task differs based on the container or resource type.
Process to create a task.

For example, the following steps may occur:
  1. Create the task:
    Creating a task on a quote or application
    To create a task on a quote or application, execute the following API call:
    Endpoint
    POST /applications/{systemId}/tasks
    Example Request Body
    {
      "templateId": "ApplicationTask0001",
      "priority": 0,
      "description": "Contact applicant to get more details",
      "workDt": "2021-04-20"
    }
    Note: The task template configuration determines which fields are required and the values differ based on agent selections.
    Creating a task on a policy
    To create a task on a policy, execute the following API call:
    Endpoint
    POST /policies/{systemId}/tasks
    Example Request Body
    {
      "templateId": "PolicyTask0002",
      "priority": 0,
      "description": "Task to check the status",
      "reportTo": "bobagent",
      "workDt": "2021-04-19",
      "dueDt": "2021-04-19"
    }
    Note: The task template configuration determines which fields are required and the values differ based on agent selections.
  2. Locate the systemId of the new task.
    After you create a policy task or an application task, the location field in the header of the API response includes the URL of the new task and the systemID of the new task:
    ...
     date: Mon19 Apr 2021 14:22:37 GMT 
     feature-policy: fullscreen 'none'; microphone 'none' 
     haproxy: haproxy-ingress-9bfc7d8df-r9shh 
     location: http://hostname/coreapi/v5/tasks/systemID 
     referrer-policy: no-referrer  
    ...