Hi guys!
I am trying to resolve many incidents by Postman.
So, I set up a Postman order like this:
GET {{base-url}}/rest/incident?processDefinitionId=CheckoutWebFlow:3:0c1a0e90-334b-11eb-8c3b-5e93526b4bdc&activityId=UpdateCheckoutStatusAcceptedTask&maxResults=1
I got this result:
[
{
“id”: “0a171d7c-54db-11eb-ae13-be347f09790a”,
“processDefinitionId”: “CheckoutWebFlow:3:0c1a0e90-334b-11eb-8c3b-5e93526b4bdc”,
“processInstanceId”: “3971fac7-1e9a-11eb-adbc-2a10bcbe5ba9”,
“executionId”: “3971fac7-1e9a-11eb-adbc-2a10bcbe5ba9”,
“incidentTimestamp”: “2021-01-12T10:35:31.000-0300”,
“incidentType”: “failedJob”,
“activityId”: “UpdateCheckoutStatusAcceptedTask”,
“causeIncidentId”: “0a171d7c-54db-11eb-ae13-be347f09790a”,
“rootCauseIncidentId”: “0a171d7c-54db-11eb-ae13-be347f09790a”,
“configuration”: “3994ec37-1e9a-11eb-adbc-2a10bcbe5ba9”,
“incidentMessage”: “Error Deleting 500 Internal Server Error”,
“tenantId”: null,
“jobDefinitionId”: “0c1a35a1-334b-11eb-8c3b-5e93526b4bdc”
}
]
And in the Postman’s test guide I put this script:
var incidents = pm.response.json();
var count = incidents.length;
console.log(‘Retrying ’ + count + ’ instances…’);
for(var i=0; i < count ; i++){
var incident = incidents[i];
pm.sendRequest(
{
method: ‘DELETE’,
url: pm.variables.get(‘base-url’) + ‘/rest/incident/’ + incident.id
}, function(err, res){
console.log(res);
}
);
}
But I got this console result:
GET http://localhost/rest/incident?processDefinitionId=CheckoutWebFlow:3:0c1a0e90-334b-11eb-8c3b-5e93526b4bdc&activityId=UpdateCheckoutStatusAcceptedTask&maxResults=1200620 ms
Retrying 1 instances…
DELETE http://localhost/rest/incident/0a171d7c-54db-11eb-ae13-be347f09790a400152 ms
{id: “ff075c9b-50cc-4cf9-82c5-0206b244b49d”, status: “Bad Request”, code: 400…}
What is miss?