Content
Updated by Wieland Lindenthal 27 days ago
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
* The **Work packages** section has two more event types
been renamed to **Work package changes**
* Comment
* Internal comment
* To maintain backwards compatibility webhooks **Work package changes** will continue firing and executing requests for "Updated" events if "Comments" and "Internal Comments" are not activated.
* If "Comments" is activated then it will fire on non-internal adding comments.
* The JSON Payload will be equivalent to the corresponding API V3 Activity representation (JSON)
There are two more events below **Work package changes**
* It will not fire for new internal comments. **Work package normal comments:** \[ \] Created
* It will not send an extra request for work **Work package "updated". internal comments:** \[ \] Created
* If "Internal comments" The payload is activated then it will fire on internal comments.
* The JSON Payload will the one that would also be equivalent to retrievable via `/api/v3/activity/{id}` and embeds the corresponding API V3 Activity representation (JSON)
* It will not fire for non-internal comments
* It will not send an extra request for work package "updated".
* <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> information about the author/user sending the comment but also about the model (work package) it belongs to.
**Acceptance criteria**
In the form for setting up or editing a webhook in the **Enabled events** section
* The **Work packages** section has two more event types
* Internal comment
* To maintain backwards compatibility webhooks
* If "Comments" is activated then it will fire on non-internal
* It will not send an extra request for work
* If "Internal comments"
* The JSON Payload will
* It will not fire for non-internal comments
* It will not send an extra request for work package "updated".
* <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>