Skip to main content

Hi,


I’m trying to make an API call to reassign an incident while keeping the status as “acknowledged”.

I’m using this endpoint with the following request body:



{

“incident”: {

“type”: “incident_reference”,

“status”: “acknowledged”,

“assignments”:

{

“assignee”: {

“id”: “PX****8”,

“type”: “user_reference”,

“summary”: “User”

}

}

]

}

}



which successfully acknowledges the user but ignores the assignee field. Instead, the call will assign the incident to the user specified in the from field:



{

“incident”: {

“incident_number”: 60####9,

“title”: “Test incident”,

“description”: “Test incident”,

“created_at”: “2023-06-26T14:09:49Z”,

“updated_at”: “2023-06-26T16:24:31Z”,

“status”: “acknowledged”,

“incident_key”: “f1#############################4”,

“service”: {

“id”: “PS####U”,

“type”: “service_reference”,

“summary”: “austin-webhook-test”,

“self”: “https://api.pagerduty.com/services/PS####U”,

“html_url”: “https://dev-########.pagerduty.com/service-directory/PS####U

},

“assignments”: b

{

“at”: “2023-06-26T15:12:07Z”,

“assignee”: {

“id”: “PA####M”,

“type”: “user_reference”,

“summary”: “user”,

“self”: “https://api.pagerduty.com/users/PA####M”,

“html_url”: “https://dev-########.pagerduty.com/users/PA####M

}

}

],

“assigned_via”: “direct_assignment”,

“last_status_change_at”: “2023-06-26T15:12:07Z”,

“resolved_at”: null,



“pending_actions”: <],

“acknowledgements”:

{

“at”: “2023-06-26T15:12:07Z”,

“acknowledger”: {

“id”: “PA####M”,

“type”: “user_reference”,

“summary”: “user”,

“self”: “https://api.pagerduty.com/users/PA####M”,

“html_url”: “https://dev-########.pagerduty.com/users/PA####M

}

},

{

“at”: “2023-06-26T15:12:25Z”,

“acknowledger”: {

“id”: “PA####M”,

“type”: “user_reference”,

“summary”: “user”,

“self”: “https://api.pagerduty.com/users/PA####M”,

“html_url”: “https://dev-########.pagerduty.com/users/PA####M

}

},

{

“at”: “2023-06-26T15:12:31Z”,

“acknowledger”: {

“id”: “PA####M”,

“type”: “user_reference”,

“summary”: “user”,

“self”: “https://api.pagerduty.com/users/PA####M”,

“html_url”: “https://dev-########.pagerduty.com/users/PA####M

}

},

{

“at”: “2023-06-26T16:24:31Z”,

“acknowledger”: {

“id”: “PA####M”,

“type”: “user_reference”,

“summary”: “user”,

“self”: “https://api.pagerduty.com/users/PA####M”,

“html_url”: “https://dev-########.pagerduty.com/users/PA####M

}

}

],

“basic_alert_grouping”: null,

“alert_grouping”: null,

“last_status_change_by”: {

“id”: “PA####M”,

“type”: “user_reference”,

“summary”: “user”,

“self”: “https://api.pagerduty.com/users/PA####M”,

“html_url”: “https://dev-########.pagerduty.com/users/PA####M

},



“id”: “Q0###########C”,

“type”: “incident”,

“summary”: “a#60####9] Test incident”,

“self”: “https://api.pagerduty.com/incidents/Q0###########C”,

“html_url”: “https://dev-########.pagerduty.com/incidents/Q0###########C

}

}



Is this a bug? Or is there a different way that I’m supposed to be updating incidents? I vaguely remember this working as I expected in the past but have received complaints that the assignee is not being correctly set in PagerDuty.

Just to bump the thread, I replicated the issue and it seems that the update incident API is still ignoring the assignments field in the request body.


Currently, the only way I am able to assign a user to an incident through the API is to set the assignee in the from field instead, which yields an inaccurate incident history when you look at the incident timeline.


Hi @austin moss-ennis! You are reading that correctly. The user that acks the incident takes ownership. From the docs:


The user that acknowledges an incident claims ownership of the issue, and halts the escalation process.


So, yes, you can set the FROM header to the user you want to assign to the incident when you ack it, or you can send a separate request to reassign the incident after it is acknowledged.


HTH

–mandi


Reply