# How to update problem comment in Dynatrace from Pagerduty

**URL:** <https://community.dynatrace.com/t/how-to-update-problem-comment-in-dynatrace-from-pagerduty/50290>\
**Category:** Automations\
**Tags:** integrations, problem-notification, pagerduty\
**Created:** [February 17, 2025, 5:09am UTC](https://community.dynatrace.com/t/how-to-update-problem-comment-in-dynatrace-from-pagerduty/50290 "2025-02-17T05:09:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![roy339](https://avatars.discourse-cdn.com/v4/letter/r/df788c/32.png) [@roy339](https://community.dynatrace.com/u/roy339)\
**Post date:** [February 17, 2025, 5:09am UTC](https://community.dynatrace.com/t/how-to-update-problem-comment-in-dynatrace-from-pagerduty/50290/1 "2025-02-17T05:09:44Z")

</div>

Hi&nbsp; Community,

Done an integration with PagerDuty and we need a update comment section in an open problem for which an alert/incident got created in PagerDuty. Our requirement is to update the comment in Dynatrace problem record once someone acknowledge or update the status in PagerDuty.

---

<div class="post-metadata">

**Author:** ![ChadTurner](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/chadturner/32/161_2.png) [@ChadTurner](https://community.dynatrace.com/u/ChadTurner)\
**Post date:** [April 25, 2025, 4:33pm UTC](https://community.dynatrace.com/t/how-to-update-problem-comment-in-dynatrace-from-pagerduty/50290/2 "2025-04-25T16:33:16Z")

</div>

Does pager duty have the ability to call out to the Dynatrace API? If so, you can script the system to take the problem card ID, Post in the desired comment via the Dynatrace API with a valid token to post the data into the problem card.

---

<div class="post-metadata">

**Author:** ![marco\_irmer](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/marco_irmer/32/3038_2.png) [@marco\_irmer](https://community.dynatrace.com/u/marco_irmer)\
**Post date:** [April 25, 2025, 6:55pm UTC](https://community.dynatrace.com/t/how-to-update-problem-comment-in-dynatrace-from-pagerduty/50290/3 "2025-04-25T18:55:20Z")

</div>

Adding to Chad’s comment above, the specific documentation for posting a comment via API can be found [here](https://docs.dynatrace.com/docs/discover-dynatrace/references/dynatrace-api/environment-api/problems-v2/comments/post-comment).

---

<div class="post-metadata">

**Author:** ![christian\_kreuz](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/christian_kreuz/32/21669_2.png) [@christian\_kreuz](https://community.dynatrace.com/u/christian_kreuz)\
**Post date:** [May 19, 2025, 3:07pm UTC](https://community.dynatrace.com/t/how-to-update-problem-comment-in-dynatrace-from-pagerduty/50290/4 "2025-05-19T15:07:56Z")

</div>

Within Workflows, you can always use a [Run JavaScript action](https://docs.dynatrace.com/docs/analyze-explore-automate/workflows/default-workflow-actions/run-javascript-workflow-action) with the [Classic Environment V2 SDK’s createComment](https://developer.dynatrace.com/develop/sdks/client-classic-environment-v2/#createcomment) method.

```javascript
import { execution } from '@dynatrace-sdk/automation-utils';
import { problemsClient } from '@dynatrace-sdk/client-classic-environment-v2';

export default async function ({ executionId }) {
  // get the current execution
  const ex = await execution(executionId);

  // get event data
  const eventData = await ex.event();

  // comment on problem
  return await problemsClient.createComment({
    problemId: eventData['event.id'],
    body: { message: 'Looking into it...' }
  });
}

```
