This script provides a basic structure that can be utilized to import historical incident data from Pagerduty to incident.io.
For best results, we recommend doing further mapping to ensure all fields are being mapped to your requirements.
You can use the PagerDuty API to fetch incidents and the incident.io API to add retrospective incidents.
Prerequisites
Ensure you have the necessary API keys and permissions for both services.
Also, make sure you have the required libraries installed by running:
Sample script
Here’s a simple Python script that demonstrates how you might export incidents from PagerDuty and add them as retrospective incidents to incident.io:
Note: Make sure to replace placeholders like 'your_pagerduty_token', and 'your_incidentio_token', and customize the data fields according to your needs. Also, you will need to add a loop to handle pagination if there are many incidents in PagerDuty.