Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 触发器企业微信机器人通知webhook通知失败的问题 #1461

Merged
merged 2 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions config/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import base64
import datetime
import importlib
import os
from urllib.parse import urljoin, urlparse

from blueapps.conf.default_settings import * # noqa
Expand Down Expand Up @@ -971,3 +972,14 @@ def redirect_func(request):
PIPELINE_ENGINE_ADMIN_API_PERMISSION = (
"itsm.helper.permissions.check_permission_success"
)

if RUN_VER == "ieod":
QW_WEB_HOOK_URL = os.getenv(
"BKAPP_QW_WEB_HOOK_URL",
"http://in.qyapi.weixin.qq.com/cgi-bin/webhook/send?key={}",
)
else:
QW_WEB_HOOK_URL = os.getenv(
"BKAPP_QW_WEB_HOOK_URL",
"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key={}",
)
1 change: 1 addition & 0 deletions docs/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
【新增】meta上下文管理功能,应用于快速审批、MOA和通知过滤
【修复】API请求节点POST参数编辑渲染问题
【修复】"提交"按钮未国际化,英语界面下"返回单据列表"按钮文字超出
【修复】触发器企业微信机器人通知webhook通知发送失败


## [Version: 2.7.2] - 2024-11-18
Expand Down
1 change: 1 addition & 0 deletions docs/RELEASE_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
【Feature】Add meta context management, applied to fast approval, MOA, and notification receivers filter.
【Fix】API request node POST parameter editing rendering issue.
【Fix】"Submit" button was not internationalized, "Return to Ticket List" button text overflow.
【Fix】Resolve the issue of WeChat Work Bot Trigger webhook notification failure.


## [Version: 2.7.2] - 2024-11-18
Expand Down
5 changes: 3 additions & 2 deletions itsm/component/utils/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@

from common.log import logger
from common.sub_string import sub_string
from django.conf import settings


WEB_HOOK_URL = "http://in.qyapi.weixin.qq.com/cgi-bin/webhook/send?key={}"
QW_WEB_HOOK_URL = settings.QW_WEB_HOOK_URL


class Announcement(Thread):
Expand Down Expand Up @@ -63,7 +64,7 @@ def run(self):
if self.chat_ids is not None:
data["chatid"] = self.chat_ids
resp = session.post(
url=WEB_HOOK_URL.format(self.web_hook_id),
url=QW_WEB_HOOK_URL.format(self.web_hook_id),
data=json.dumps(data),
verify=False,
)
Expand Down