[PR #691] [CLOSED] feat: add webhook #1068

Closed
opened 2026-02-04 21:47:52 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/plankanban/planka/pull/691
Author: @HannesOberreiter
Created: 4/8/2024
Status: Closed

Base: masterHead: webhook


📝 Commits (4)

  • 84e181a feat: add webhook
  • a0c7c73 docs: 📝 add comments
  • 9ad2a34 refactor: ♻️ move env variables to init
  • c129e83 fix: 🐛 fix slack

📊 Changes

10 files changed (+220 additions, -93 deletions)

View changed files

📝 server/.env.sample (+3 -0)
📝 server/api/controllers/cards/delete.js (+4 -3)
📝 server/api/controllers/comment-actions/delete.js (+8 -3)
📝 server/api/helpers/actions/create-one.js (+1 -27)
📝 server/api/helpers/actions/delete-one.js (+11 -0)
📝 server/api/helpers/cards/delete-one.js (+13 -7)
server/api/helpers/utils/send-message.js (+175 -0)
server/api/helpers/utils/send-slack-message.js (+0 -53)
📝 server/api/models/Action.js (+2 -0)
📝 server/config/custom.js (+3 -0)

📄 Description

This pull request introduces the ability to configure a global webhook URL. This allows notifications to be sent to a destination of your choice, in addition to Slack.

Why a global webhook? A global webhook would allow easily to integrate other in-house and more solutions without the need to wait for features arrive in plankaban.

# WEBHOOK_URL=
# WEBHOOK_BEARER_TOKEN=(optional)

To support this feature, I've refactored the existing Slack message utility to be more versatile and handle message generation internally.

Additional Changes:

  • Potential Bug Fix: In comment-actions/delete.js, there's a call to actions.deleteOne which might be unintended. I've left it for review.
  • Notification Refactoring: The notification for card deletion has been moved to a more appropriate location.
  • Added new action if a comment or card is deleted.

Testing Note:

I wasn't able to test the Slack integration changes myself as I don't have Slack installed. However, I reviewed the official Slack documentation and identified some discrepancies between the current implementation and the official docs. Further review and testing are needed! Did send wrong encoding and moved to JSON which seems simpler, now it works (https://api.slack.com/web#posting_json).

Improvements:

Add more actions to the global webhook, eg. user created, boards etc.

Possible related issues: https://github.com/plankanban/planka/issues/656, https://github.com/plankanban/planka/issues/215


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/plankanban/planka/pull/691 **Author:** [@HannesOberreiter](https://github.com/HannesOberreiter) **Created:** 4/8/2024 **Status:** ❌ Closed **Base:** `master` ← **Head:** `webhook` --- ### 📝 Commits (4) - [`84e181a`](https://github.com/plankanban/planka/commit/84e181a2876b8d96dc89f05c348d475093567202) feat: :sparkles: add webhook - [`a0c7c73`](https://github.com/plankanban/planka/commit/a0c7c73372888e04772bf4eda229a119d48832d8) docs: :memo: add comments - [`9ad2a34`](https://github.com/plankanban/planka/commit/9ad2a340bfffaa19344baa362d9267ccf5f1b766) refactor: :recycle: move env variables to init - [`c129e83`](https://github.com/plankanban/planka/commit/c129e8353c4a6a98e2ba84cc2d5cd51add141474) fix: :bug: fix slack ### 📊 Changes **10 files changed** (+220 additions, -93 deletions) <details> <summary>View changed files</summary> 📝 `server/.env.sample` (+3 -0) 📝 `server/api/controllers/cards/delete.js` (+4 -3) 📝 `server/api/controllers/comment-actions/delete.js` (+8 -3) 📝 `server/api/helpers/actions/create-one.js` (+1 -27) 📝 `server/api/helpers/actions/delete-one.js` (+11 -0) 📝 `server/api/helpers/cards/delete-one.js` (+13 -7) ➕ `server/api/helpers/utils/send-message.js` (+175 -0) ➖ `server/api/helpers/utils/send-slack-message.js` (+0 -53) 📝 `server/api/models/Action.js` (+2 -0) 📝 `server/config/custom.js` (+3 -0) </details> ### 📄 Description This pull request introduces the ability to configure a global webhook URL. This allows notifications to be sent to a destination of your choice, in addition to Slack. Why a global webhook? A global webhook would allow easily to integrate other in-house and more solutions without the need to wait for features arrive in plankaban. ```env # WEBHOOK_URL= # WEBHOOK_BEARER_TOKEN=(optional) ``` To support this feature, I've refactored the existing Slack message utility to be more versatile and handle message generation internally. Additional Changes: - Potential Bug Fix: In comment-actions/delete.js, there's a call to actions.deleteOne which might be unintended. I've left it for review. - Notification Refactoring: The notification for card deletion has been moved to a more appropriate location. - Added new action if a comment or card is deleted. Testing Note: ~~I wasn't able to test the Slack integration changes myself as I don't have Slack installed. However, I reviewed the official Slack documentation and identified some discrepancies between the current implementation and the official docs. **Further review and testing are needed!**~~ Did send wrong encoding and moved to JSON which seems simpler, now it works (https://api.slack.com/web#posting_json). Improvements: Add more actions to the global webhook, eg. user created, boards etc. Possible related issues: https://github.com/plankanban/planka/issues/656, https://github.com/plankanban/planka/issues/215 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-04 21:47:52 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/planka#1068