Following my earlier post on creating a new statuspage incident, we are now going to update the incident. We use the same input form as before but this time use the status "Update" :
This triggers a flow once submitted which looks like this:
This time we are going to run two custom scripts; the first will search statuspage and find the incident we are looking to update and the second will apply the updates.
For the getStatuspageIncs step we are again using a function in the shared library for most of the code as will be using that code in other places.
Here is the code in the custom step:
and here is the function in the shared library:
If an incident can't be found with our incident name the script will stop at this point due to the switch step (spIncFound?). If the incident number is found we can then proceed with the updateStatusPageInc step:
The only thing to note here is that we are using 'PATCH' for the request method but the statuspage api docs are pretty clear.