Service Desk Plus - Generic Polling

This playbook uses generic polling to wait until a request is closed.

Manage Engine Service Desk Plus · 6 tasks · 3 inputs · 2 outputs

Details

IDService Desk Plus - Generic Polling
From Version5.0.0
Tasks6

README

This playbook uses generic polling to wait until a request is closed.

Dependencies

This playbook uses the following sub-playbooks, integrations, and scripts.

Sub-playbooks

  • GenericPolling

Integrations

  • ServiceDeskPlus

Scripts

  • AreValuesEqual

Commands

  • service-desk-plus-request-close
  • service-desk-plus-requests-list

Playbook Inputs


Name Description Default Value Required
RequestId The id of the Service Desk Plus request   Required
Timeout Amount of time to poll before declaring a timeout and resuming the playbook (minutes).   Required
Interval Frequency that the polling command will run (minutes).   Required

Playbook Outputs


Path Description Type
${ServiceDeskPlus.Request.ClosureInfo.closure_comments} The closure comments added to the request. unknown
${ServiceDeskPlus.Request.ClosureInfo.closure_code} The closure code added to the request unknown

Playbook Image


Service Desk Plus - Generic Polling

Inputs

  • RequestId — The id of the Service Desk Plus request
  • Timeout — Amount of time to poll before declaring a timeout and resuming the playbook (minutes).
  • Interval — Frequency that the polling command will run (minutes).

Outputs

  • ${ServiceDeskPlus.Request.ClosureInfo.closure_comments} — The closure comments added to the request.
  • ${ServiceDeskPlus.Request.ClosureInfo.closure_code} — The closure code added to the request

Commands used

service-desk-plus-requests-list

Flowchart

no yes Start Start GenericPolling - GenericPolling GenericPolling GenericPolling Refresh Request Status - service-desk-plus-requests-list Refresh Request Status service-desk-plus-requests-list Validate Request is Closed - AreValuesEqual Validate Request is Closed AreValuesEqual Done Done Close request - PrintErrorEntry Close request PrintErrorEntry
id: Service Desk Plus - Generic Polling
version: -1
name: Service Desk Plus - Generic Polling
description: This playbook uses generic polling to wait until a request is closed.
starttaskid: "0"
tasks:
  "0":
    id: "0"
    taskid: 6ca85d2e-e3c6-44db-8f9e-5e9bd882741d
    type: start
    task:
      id: 6ca85d2e-e3c6-44db-8f9e-5e9bd882741d
      version: -1
      name: ""
      iscommand: false
      brand: ""
      description: ''
    nexttasks:
      '#none#':
      - "1"
    separatecontext: false
    view: |-
      {
        "position": {
          "x": 50,
          "y": 50
        }
      }
    note: false
    timertriggers: []
    ignoreworker: false
    skipunavailable: false
    quietmode: 0
  "1":
    id: "1"
    taskid: e2044667-4290-4fc3-86a1-7d58d05a7b28
    type: playbook
    task:
      id: e2044667-4290-4fc3-86a1-7d58d05a7b28
      version: -1
      name: GenericPolling
      description: |-
        Use this playbook as a sub-playbook to block execution of the master playbook until a remote action is complete.
        This playbook implements polling by continuously running the command in Step \#2 until the operation completes.
        The remote action should have the following structure:

        1. Initiate the operation.
        2. Poll to check if the operation completed.
        3. (optional) Get the results of the operation.
      playbookName: GenericPolling
      type: playbook
      iscommand: false
      brand: ""
    nexttasks:
      '#none#':
      - "2"
    scriptarguments:
      Ids:
        simple: ${inputs.RequestId}
      Interval:
        simple: ${inputs.Interval}
      PollingCommandArgName:
        simple: request_id
      PollingCommandName:
        simple: service-desk-plus-requests-list
      Timeout:
        simple: ${inputs.Timeout}
      dt:
        simple: ServiceDeskPlus.Request(val.Status !== 'Closed').Id
    separatecontext: true
    loop:
      iscommand: false
      exitCondition: ""
      wait: 1
      max: 100
    view: |-
      {
        "position": {
          "x": 50,
          "y": 195
        }
      }
    note: false
    timertriggers: []
    ignoreworker: false
    skipunavailable: false
    quietmode: 0
  "2":
    id: "2"
    taskid: 9f900310-4434-49d1-8fd0-61900f39172b
    type: regular
    task:
      id: 9f900310-4434-49d1-8fd0-61900f39172b
      version: -1
      name: Refresh Request Status
      description: View the details of requests. If no parameters are given the details
        of all requests will be shown.
      script: ServiceDeskPlus|||service-desk-plus-requests-list
      type: regular
      iscommand: true
      brand: ServiceDeskPlus
    nexttasks:
      '#none#':
      - "3"
    scriptarguments:
      request_id:
        simple: ${inputs.RequestId}
    separatecontext: false
    view: |-
      {
        "position": {
          "x": 50,
          "y": 370
        }
      }
    note: false
    timertriggers: []
    ignoreworker: false
    skipunavailable: false
    quietmode: 0
  "3":
    id: "3"
    taskid: 8e0d6b9e-9dcc-4442-8266-fad3d042f692
    type: condition
    task:
      id: 8e0d6b9e-9dcc-4442-8266-fad3d042f692
      version: -1
      name: Validate Request is Closed
      description: Check whether the values provided in arguments are equal. If either
        of the arguments are missing, no is returned.
      scriptName: AreValuesEqual
      type: condition
      iscommand: false
      brand: ""
    nexttasks:
      "no":
      - "5"
      "yes":
      - "4"
    scriptarguments:
      left:
        simple: ${ServiceDeskPlus.Request.Status}
      right:
        simple: Closed
    results:
    - AreValuesEqual
    separatecontext: false
    view: |-
      {
        "position": {
          "x": 50,
          "y": 545
        }
      }
    note: false
    timertriggers: []
    ignoreworker: false
    skipunavailable: false
    quietmode: 0
  "4":
    id: "4"
    taskid: a8ee09dd-692a-4e27-8145-73198cb12267
    type: title
    task:
      id: a8ee09dd-692a-4e27-8145-73198cb12267
      version: -1
      name: Done
      type: title
      iscommand: false
      brand: ""
      description: ''
    separatecontext: false
    view: |-
      {
        "position": {
          "x": 50,
          "y": 890
        }
      }
    note: false
    timertriggers: []
    ignoreworker: false
    skipunavailable: false
    quietmode: 0
  "5":
    id: "5"
    taskid: 5f07445f-7a29-445c-8357-5189ce6d1ac5
    type: regular
    task:
      id: 5f07445f-7a29-445c-8357-5189ce6d1ac5
      version: -1
      name: Close request
      description: Prints an error entry with a given message.
      scriptName: PrintErrorEntry
      type: regular
      iscommand: false
      brand: ""
    scriptarguments:
      message:
        simple: The ID '${ServiceDeskPlus.Request.Id}' wasn't closed.
    separatecontext: false
    view: |-
      {
        "position": {
          "x": 380,
          "y": 720
        }
      }
    note: false
    timertriggers: []
    ignoreworker: false
    skipunavailable: false
    quietmode: 0
system: true
view: |-
  {
    "linkLabelsPosition": {
      "3_4_yes": 0.48
    },
    "paper": {
      "dimensions": {
        "height": 905,
        "width": 710,
        "x": 50,
        "y": 50
      }
    }
  }
inputs:
- key: RequestId
  value: {}
  required: true
  description: The id of the Service Desk Plus request
  playbookInputQuery: null
- key: Timeout
  value: {}
  required: true
  description: Amount of time to poll before declaring a timeout and resuming the
    playbook (minutes).
  playbookInputQuery: null
- key: Interval
  value: {}
  required: true
  description: Frequency that the polling command will run (minutes).
  playbookInputQuery: null
outputs:
- contextPath: ${ServiceDeskPlus.Request.ClosureInfo.closure_comments}
  description: The closure comments added to the request.
  type: unknown
- contextPath: ${ServiceDeskPlus.Request.ClosureInfo.closure_code}
  description: The closure code added to the request
  type: unknown
fromversion: 5.0.0
tests:
- Service Desk Plus - Generic Polling Test