GetIncidentTasks
Get all tasks for a specific incident by the given state, name and/or tag.
javascript · Cortex REST API
Details
| ID | GetIncidentTasks |
|---|---|
| Language | javascript |
| From Version | 6.10.0 |
| Tags | Utility |
README
Get all tasks for a specific incident by the given state, name and/or tag.
Script Data
| Name | Description |
|---|---|
| Script Type | javascript |
| Tags | Utility |
| Cortex XSOAR Version | 6.10.0 |
Dependencies
This script uses the following commands and scripts.
- Core REST API
- core-api-get
Inputs
| Argument Name | Description |
|---|---|
| inc_id | Incident ID to get tasks from. |
| states | Comma-separated list of states. Possible values: New, InProgress, Completed, Waiting, Error, LoopError, Skipped, Blocked. (Leave empty to get all tasks). |
| name | The name of the task to search. |
| tag | The tag to search. |
| using | The Cortex REST API integration instance to use for the API request. If not provided, the default instance is used. |
Outputs
| Path | Description | Type |
|---|---|---|
| Tasks | The entire task object. | Unknown |
| Tasks.id | Task ID. | string |
| Tasks.name | Task name. | string |
| Tasks.type | The type of the task (regular, condition, title, playbook, start). | string |
| Tasks.owner | Task owner. | string |
| Tasks.state | Task state (inprogress, Completed, WillNotBeExecuted, Error, LoopError, Waiting, Blocked, and empty string for not started). | string |
| Tasks.scriptId | Task related script (empty if manual). | string |
| Tasks.startDate | Task start date. | unknown |
| Tasks.completedDate | Task completed date. | unknown |
| Tasks.dueDate | Task due date (SLA). | unknown |
| Tasks.parentPlaybookID | Task parent playbook ID (in case the task is part of a sub-playbook). | unknown |
| Tasks.completedBy | Task completed by (username). | string |
Script Examples
Example command
!GetIncidentTasks inc_id=10 name="Email Campaign Search"
Context Example
{
"Tasks": {
"completedBy": "DBot",
"completedDate": "2024-01-09T12:26:33.75641877Z",
"dueDate": "0001-01-01T00:00:00Z",
"id": "101",
"name": "Email Campaign Search",
"owner": "Dummy",
"parentPlaybookID": null,
"scriptId": null,
"startDate": "0001-01-01T00:00:00Z",
"state": "Completed",
"type": "title"
}
}
Human Readable Output
Incident #10 Playbook Tasks
id name state owner scriptId 101 Email Campaign Search Completed Dummy
commonfields: id: GetIncidentTasks version: -1 name: GetIncidentTasks script: '' type: javascript tags: - Utility comment: Get all tasks for a specific incident by the given state, name and/or tag. enabled: true args: - name: inc_id required: true default: true description: Incident ID to get tasks from. - name: states isArray: true description: 'Comma-separated list of states. Possible values: New, InProgress, Completed, Waiting, Error, LoopError, Skipped, Blocked. (Leave empty to get all tasks).' - name: name description: 'The name of the task to search.' - name: tag description: 'The tag to search.' - name: using description: 'The Cortex REST API integration instance to use for the API request. If not provided, the default instance is used.' outputs: - contextPath: Tasks description: The entire task object. - contextPath: Tasks.id description: Task ID. type: string - contextPath: Tasks.name description: Task name. type: string - contextPath: Tasks.type description: The type of the task (regular, condition, title, playbook, start). type: string - contextPath: Tasks.owner description: Task owner. type: string - contextPath: Tasks.state description: Task state (inprogress, Completed, WillNotBeExecuted, Error, LoopError, Waiting, Blocked, and empty string for not started). type: string - contextPath: Tasks.scriptId description: Task related script (empty if manual). type: string - contextPath: Tasks.startDate description: Task start date. type: unknown - contextPath: Tasks.completedDate description: Task completed date. type: unknown - contextPath: Tasks.dueDate description: Task due date (SLA). type: unknown - contextPath: Tasks.parentPlaybookID description: Task parent playbook ID (in case the task is part of a sub-playbook). type: unknown - contextPath: Tasks.completedBy description: Task completed by (username). type: string scripttarget: 0 sensitive: true tests: - No test fromversion: 6.10.0