File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -88,8 +88,15 @@ if [ -z "$pd_token" ]; then
88
88
exit 0
89
89
fi
90
90
91
- curl --silent --request GET \
91
+ # Pagerduty seems to need a short while to create the incident
92
+ # Added this as we intermittently fail to get the incident id otherwise
93
+ sleep 2
94
+
95
+ INCIDENT_ID=$( curl --silent --request GET \
92
96
--url " https://api.pagerduty.com/incidents?incident_key=${dedup_key} " \
93
97
--header ' Accept: application/json' \
94
98
--header " Authorization: Token token=${pd_token} " \
95
- --header ' Content-Type: application/json' | jq -r ' .incidents[0].id'
99
+ --header ' Content-Type: application/json' | jq -r ' .incidents[0].id' )
100
+ echo $INCIDENT_ID
101
+ echo ' {"__pd_metadata":{"incident":{"id":"' $INCIDENT_ID ' "}}}' > ./payload
102
+ echo " Created ./payload"
You can’t perform that action at this time.
0 commit comments