Skip to content

pagerduty list-incidents

List incidents

Description

List PagerDuty incidents

Synopsis

pagerduty list-incidents
    --site <site>
    [--limit <limit>]
    [--offset <offset>]
    [--incident_key <incident_key>]
    [--include <include>]

Arguments

site - (string)

     Site where this command will be executed
     Example: --site "site-1"
     Default: input.site      Attributes: required

limit - (int)

     The number of results per page.
     Example: --limit 10
     Default: 25      Attributes: optional

offset - (int)

     Offset to start pagination search results.
     Example: --offset 10
     Default: _None_      Attributes: optional

incident_key - (string)

     Return only the incidents associated with the passed team(s)
     Example: --incident_key "incident_key-1"
     Default: _None_      Attributes: optional, multiple allowed

include - (string)

     Array of additional details to include
     Example: --include "include-1"
     Default: _None_      Attributes: optional, multiple allowed

     Validation:
         allowed values: users, services, first_trigger_log_entries, escalation_policies, teams, assignees, acknowledgers, priorities, conference_bridge

Examples

Input:

!pagerduty list-incidents
Output:
ID              TITLE       ASSIGNEE        STATUS       
Q3O2DXG783FJFA  New test    Pavan Subhakar  acknowledged    
Q3TLHH2JYZA8M6  new user    Avinash         triggered  
Input:
x= !pagerduty list-incidents --id "Q3O2DXG783FJFA"
Output:
{
  "incident": {
    "incident_number": 1,
    "title": "New test",
    "description": "New test",
    "created_at": "2022-11-08T12:44:38Z",
    "status": "triggered",
    "incident_key": "61f9ac0c0449478f92b514803a23b1f1",
    "service": {
      "id": "PKAT53N",
      "type": "service_reference",
      "summary": "TestForIMPL",
      "self": "https://api.pagerduty.com/services/PKAT53N",
      "html_url": "https://maira.pagerduty.com/service-directory/PKAT53N"
    },
    "assignments": [
      {
        "at": "2022-11-08T12:44:38Z",
        "assignee": {
          "id": "P56N7LQ",
          "type": "user_reference",
          "summary": "Pavan Subhakar",
          "self": "https://api.pagerduty.com/users/P56N7LQ",
          "html_url": "https://maira.pagerduty.com/users/P56N7LQ"
        }
      }
    ],
    "assigned_via": "direct_assignment",
    "last_status_change_at": "2022-11-11T10:55:08Z",
    "first_trigger_log_entry": {
      "id": "R5U3O7T9HQMY7G26BE5HBRY2K5",
      "type": "trigger_log_entry_reference",
      "summary": "Triggered through the website.",
      "self": "https://api.pagerduty.com/log_entries/R5U3O7T9HQMY7G26BE5HBRY2K5",
      "html_url": "https://maira.pagerduty.com/incidents/Q3O2DXG783FJFA/log_entries/R5U3O7T9HQMY7G26BE5HBRY2K5"
    },
    "alert_counts": { "all": 0, "triggered": 0, "resolved": 0 },
    "is_mergeable": true,
    "escalation_policy": {
      "id": "P6GPFJT",
      "type": "escalation_policy_reference",
      "summary": "Default",
      "self": "https://api.pagerduty.com/escalation_policies/P6GPFJT",
      "html_url": "https://maira.pagerduty.com/escalation_policies/P6GPFJT"
    },
    "teams": [],
    "impacted_services": [
      {
        "id": "PKAT53N",
        "type": "service_reference",
        "summary": "TestForIMPL",
        "self": "https://api.pagerduty.com/services/PKAT53N",
        "html_url": "https://maira.pagerduty.com/service-directory/PKAT53N"
      }
    ],
    "pending_actions": [],
    "acknowledgements": [],
    "basic_alert_grouping": null,
    "alert_grouping": null,
    "last_status_change_by": {
      "id": "PKAT53N",
      "type": "service_reference",
      "summary": "TestForIMPL",
      "self": "https://api.pagerduty.com/services/PKAT53N",
      "html_url": "https://maira.pagerduty.com/service-directory/PKAT53N"
    },
    "incidents_responders": [],
    "responder_requests": [],
    "subscriber_requests": [],
    "urgency": "low",
    "id": "Q3O2DXG783FJFA",
    "type": "incident",
    "summary": "[#1] New test",
    "self": "https://api.pagerduty.com/incidents/Q3O2DXG783FJFA",
    "html_url": "https://maira.pagerduty.com/incidents/Q3O2DXG783FJFA"
  }
}

Access Control

To use this command, you need access to the following:

Field Value
Action "read"
Service Type "pagerduty"
Service Instance
Namespace
Object Type "incident"
Object ID

Please see Access Control for details.