Implement Incident Impact Timings from Opsgenie into Jira Service Management

XMLWordPrintable

    • 1

      Current State:

      Opsgenie Incidents have Impact Timings available to view and edit in the UI.
      From the main incident view, Impact Detection, Impact Duration and Elapsed time are visible showing the Hours, minutes and seconds the Impact has been going for.

      Clicking on this UI element, causes additional fields to show, some of which can be edited and the time changed:

      • Created At (R/O): showing when the Incident was created
      • Updated At (R/O): showing when the Incident was last updated
      • Impact Started at: Editable, allows setting a custom datetime different from the Incident Creation time (which is the default value)
      • Impact Ended at: Editable, allows setting a custom datetime different from when the incident moved to a resolve state
      • Impact Detected at: Editable, allows setting a custom datetime

      Proposed Future State:

      A Jira Service Management (JSM) Incident does not contain these fields currently, but should display them in a section of the work-item.

      Incident Created At: When the Incident was created
      Incident Ended At : Editable, and if not set when the Incident transitions to resolve, set then
      (Optional) Incident Detected at: Editable, allowing a custom date/time. Default to Created At time

      And then Impact Duration, which needs the following logic:
      If the Incident is not resolved, then the value is <Current Time> - Impact Detected at
      If the incident is resolved, the value is Impact Ended at - Impact Detected at

      Workarounds:

      This workaround walks you through setting up custom fields and automation rules on the [System] incident work-item type in Jira Service Management to automatically track incident timestamps and calculate incident duration.

      What you'll setup:

      • 4 custom fields to capture incident lifecycle timestamps and duration
      • 3 automation rules to populate and calculate those fields

      Requirements:

      • Jira Service Management project administrator permissions
      • Access to project automation

      Part 1: Create the custom fields

      Reference: https://support.atlassian.com/jira-service-management-cloud/docs/add-a-new-custom-field-to-a-project/ & https://support.atlassian.com/jira-service-management-cloud/docs/add-fields-to-a-screen/

      1. Navigate to Jira Settings → Work Items → Fields
      2. In the field list, click Create field and create the following four fields. The names are important because our automations will refer to them by these names,
        "Impact Started At" : DateTime
        "Impact Ended At" : DateTime
        "Impact Detected At" : DateTime
        "Impact Duration" : Short Text (Ideally, this should also be given the default value of "Not Calculated")
      3. Set the field context — scoping it to the JSM project and [System] Incident issue type that these are apply to
      4. Split the Screen for Incident View / Edit into two screens, one for view and one for edit.
      5. Add all four fields to the Incident view layout. Ensure none of the fields is hidden from display.
      6. Add only Impact Ended at and Impact Detected at to the Incident Edit layout.

      This will make the Incident Ended at and Incident Detected at the only 2 of these fields that can be manually edited

      Field Editable from UI?
      Impact Started At ❌ No — read-only
      Impact Ended At ✅ Yes
      Impact Detected At ✅ Yes
      Impact Duration ❌ No — read-only

      Part 2: Create the automation rules

      Navigate to Project Settings → Automation and create the following three rules.

      Rule 1: Populate timestamps on incident creation

      This rule stamps both the created and detected time when an incident is first raised.

      • Trigger: Work item created
        • Condition: Issue type = [System] incident
      • Action: Edit issue fields
        • Set Impact Created At to
      {{now}}
        • Set Impact Detected At to 
          {{now}}

       

      Name the rule (e.g. "Set Impact created and detected timestamps") and enable it.

      Note: Both fields are set to now at creation. If the actual detection time differs, agents can manually update Impact Detected At afterwards (since it remains editable).

      Rule 2: Populate the end timestamp on resolution or cancellation

      This rule records when the impact ended, but only if an end time hasn't already been captured.

      • Trigger: Issue transitioned
        • Conditions (all must be true):
        • Issue type = [System] incident
        • Status changes to Completed OR Cancelled
        • Field condition: Impact Ended At is empty
      • Action: Edit issue fields
        • Set Impact Ended At to
      {{now}}

      Name the rule (e.g. "Set impact ended timestamp") and enable it.

      Note: The empty-check ensures that if an incident is re-opened and resolved again, the original end time is preserved. Remove this condition if you prefer to always overwrite with the latest resolution time.

      Rule 3: Manually calculate incident duration

      This rule is triggered manually and calculates the elapsed time between detection and end.

      • Trigger: Manual trigger, for Work Type: [System] incident
      • Add Condition: IF or ELSE
      • IF matches
        • Impact Ended At is not empty
      • Action: Edit work-item fields
        • Set Impact Duration to the calculated difference between Impact Ended At and Impact Detected At, formatted as: X days, Y hours, Z minutes
        • How to calculate: Use a smart value expression with formatting, in this case:
      {{issue.Impact Detected At.diff(issue.Impact Ended At).prettyprint}} 
      • ELSE (No need for condition as Incident Ended At will be empty here)
      • Action: Edit work-item fields
        • Set Impact Duration to the calculated difference between Now and Impact Detected At, formatted as: X days, Y hours, Z minutes
        • How to calculate: Use a smart value expression with formatting, in this case:
      {{issue.Impact Detected At.diff(now).prettyprint}} 

      Name the rule (e.g. "Calculate Impact duration") and enable it.

       

      Example output values:

      • 0 days, 2 hours, 15 minutes
      • 1 day, 0 hours, 6 minutes
      • 3 days, 12 hours, 0 minutes

      How to use

      1. Create a [System] incident — the Created At and Detected At fields are automatically populated.
      1. Adjust Impact Detected At if the actual detection time differs from creation time.
      1. Resolve or Cancel the incident — the Ended At field is automatically populated.
      1. Trigger the duration calculation by opening the incident, clicking Automation in the issue actions menu, and running "Calculate Impact duration".

      Troubleshooting

      Issue Resolution
      Timestamps not populating on creation Verify the automation rule is enabled and the issue type condition matches exactly [System] incident
      End time not stamping on resolution Check that the status name matches exactly (Completed / Cancelled) and that the field isn't already populated
      Fields are editable when they shouldn't be Review the field configuration and confirm read-only is applied for Impact Created At and Impact Duration

       

              Assignee:
              Unassigned
              Reporter:
              Scot Wilson
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: