# Feature SMHEI-22 - Commenting on work packages fires a webhook

Project: Stream Matrix Hookshot - Element Integration
Status: tested
URL: https://community.openproject.org/work_packages/SMHEI-22

## Planning

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | High |
| Target versions | 16.2.0 |
| Votes |  |
| List |  |
| Roadmap |  |
| Relevance |  |

## OPEN POINTS / FEEDBACK

| ID | Subject | Status | Decision |
| --- | --- | --- | --- |
| COMMS-328 | What do webhooks send out on an internal comment? | resolved |  |

## Use cases

_No work packages_

## Features and Chunks

_No work packages_

## Bugs and other work packages

_No work packages_

## Technical Details

| Attribute | Value |
| --- | --- |
| Module | API / Webhooks, Integrations / Element Matrix / Hookshot |
| Feature Flag |  |
| Requires doc change | Yes |
| Enterprise plan |  |

## Details

| Attribute | Value |
| --- | --- |
| Pull preview |  |
| Mockups |  |
| Accessibility | No |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable | Dominic Bräunlein |
| Product manager |  |
| Feature Lead |  |
| Developers | Jan Sandbrink |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Estimates and progress

| Attribute | Value |
| --- | --- |
| PD (min) |  |
| PD (max) |  |
| Work |  |
| Labor costs |  |

## Description

Right now, OpenProject sends only direct work package information as payload (Type, Status, Assignee, ...) but doesn't include comments. That is unfortunate as a comment can be as important as a status transition. For a useful integration we need to build that comments get transmitted via webhook calls, too.

**Acceptance criteria**

In the form for setting up or editing a webhook in the **Enabled events** section

  - A new resource type **Work package comments** is added, with two options
    
      - Comment
    
      - Internal comment

  - Firing of webhooks for **work packages** must not be affected by this new feature

  - If "Comments" is activated then it will fire on non-internal comments.
    
      - The JSON Payload will be equivalent to the corresponding API V3 Activity representation (JSON)
    
      - It will not fire for new internal comments.

  - If "Internal comments" is activated then it will fire on internal comments.
    
      - The JSON Payload will be equivalent to the corresponding API V3 Activity representation (JSON)
    
      - It will not fire for non-internal comments

**QA Notes**

One way to test webhooks is using <https://www.svix.com/play/>, which allows to register temporary URLs that can receive webhooks and will show you what they received.

Note that all those webhooks (old and new) are fired after the journals can't be aggregated anymore. That is the time after which you'd see a new activity entry on the right if you did an additional change and by default it is 5 minutes.

<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="https://private-user-images.githubusercontent.com/327272/457897280-7bd9eca9-37c2-4a94-8e45-2ebc3d0b6358.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTA2ODA5ODMsIm5iZiI6MTc1MDY4MDY4MywicGF0aCI6Ii8zMjcyNzIvNDU3ODk3MjgwLTdiZDllY2E5LTM3YzItNGE5NC04ZTQ1LTJlYmMzZDBiNjM1OC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwNjIzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDYyM1QxMjExMjNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1jYmRmZTM3YmIyMWJlMGEyOWI4YWRlNDk5MTZmMmU2ZDU0MmUzNWM5MGVjZTFjZmViMDVlZTg3MTdiNWE4MThlJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.MiZT2iVKBXLKPzhN7eT3VOPE4C7XCNErLHJBq--mDKM" alt="image"></div></figure>
