REST API to read write with Description field

Hi,

We are using the REST API. We have created one incident , now we want to fetch the value of the Description field of that incident using Rest API. Nither Log entries nor get an incident API is giving the value of description. Is there any way to get the value of the description?

Similarly is there any way we can create the incident with description and update that description through REST API?

Let me know in case of any required information.

Thank You

Regards,
Sonal

Hi Sonal,

Use the REST API on the ‘get incident’ query and then see “Summary”, this is the equivalent of “description” on the REST API

https://api-reference.pagerduty.com/#!/Incidents/get_incidents_id

John

Yes summary is equelaint of description as per API response. But my query is different we are not getting description field value niether in “description” nor in “summary”.

Following is the example:
I have created one incident with title “test title” and description “test description”

Now if i get this with ‘get_incident’ query following response i will get:
{
“incident”: {
“incident_number”: 88,
“title”: “test title”,
“description”: “test title”,
“type”: “incident”,
“summary”: “[#88] test title”,
“self”: “https://api.pagerduty.com/incidents/POFUQ0D”,
“html_url”: “https://dev-opshub.pagerduty.com/incidents/POFUQ0D
}
}

no field contains “test description” field value.

Regards,
Sonal

Hello,

It appears you have triggered the Incident from the Web UI, is that right? That details field will not be captured in that sense as it should actually be the content of the Incident body, Custom Details.
The best way to give this a go is to trigger and Incident via the Rest API or the Events API where the Incident body can be enriched with details.

Thanks,

Hello,

While creating incident pagerduty web UI have Description field which can be specified at incident creation time and can also be visible when incident is open.

Now question is, Can we confirm that there is no way to read and write Description field from API ?

PagerDuty made a change recently so that the incident’s description key maps to the value for incident title. We have updated our docs here to outline this.

Note that the description field is now deprecated. If you are doing a GET on incidents manually created in PagerDuty, the description is available in the first log entry in channel.details.

1 Like

Hello,

We created incident from PagerDuty Web UI, now we get log entry but we are not able to see channel.details in the log. We referred below apis
https://api-reference.pagerduty.com/#!/Incidents/get_incidents_id_log_entries
https://api-reference.pagerduty.com/#!/Log_Entries/get_log_entries

In the first log entry channel contain only below data
“channel”: {
“type”: “web_trigger”,
“summary”: “test incident 1234”
},

Here it contains title but not description field data.

So can you confirm how to read description field value ?

Also is there any way to write description field value via API ?

Hello,

It does appear you did not include channels in the call you made?
Would you want to give that another go and let us know how you get along?

Cheers,

Hello,

Thanks, After including channels it is now possible to get/read description field value.

What about writing description field via API ?

Currently from API, we can write details field which shown as Custom Details on PagerDuty UI and not Description. If we create incident via PagerDuty UI then it shown as Description but through API if we write details then it will shown as Custom Details.

Now question is is this not possible to write Description field via API which shown as Description ?

and next question is If Description field is going to be deprecated then will Custom details field will remain present to write on Incident via API OR that field is also going to be removed in near future ?

Hello Hardik,

Now question is is this not possible to write Description via API which shown as Description ?

The incident title will begin showing within the description field when you GET the /log_entry and include details.

and next question is If Description field is going to be deprecated then will Custom details field will remain present to write on Incident via API ?

We do not have plans to deprecate the custom_details aspect. The REST API will have a parameter to input incident details.

Here, question is different, Question is below.
Is there any way to set Description field via REST API which can visible as Description label in PagerDuty UI.

Hello Hardik,

I am afraid we currently do not have a field like that supported via the API. Let us know if you have any other questions.

John

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.