Skip to content

实现飞书at人的功能 #2593

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

Closed
snailq opened this issue Apr 9, 2025 · 4 comments
Closed

实现飞书at人的功能 #2593

snailq opened this issue Apr 9, 2025 · 4 comments
Labels

Comments

@snailq
Copy link

snailq commented Apr 9, 2025

看到博客中钉钉at人的方法,和飞书不太一样, 实现不了啊。
想利用通知规则中的 接收人或者接收团队做at指定人员的功能
(这里的接收人和接收团队感觉没什么用呢?用的通知方式是使用飞书群机器人Accesstoken)

计划添加一个联系方式:feishu_userid,人员信息中添加具体的userid,但是看了通知模板中的各种变量没有找到。

不知道怎么通过模板获取到接收人的信息?还是不支持?是否考虑增加一下这个变量?

@jicki
Copy link
Contributor

jicki commented Apr 10, 2025

飞书可以通过 email 的方式获取到 用户的 userid 的, 可以使用这个方式进行 @ 人的方式..

新版本,的飞书应用机器人已经实现了 @ 人的功能,可以试用一下看看..

如果你希望在 飞书群机器人 @ 人的话, 可能就需要在 告警规则 里面定义需要 @ 人的 email 来实现..

@UlricQin
Copy link
Member

计划添加一个联系方式:feishu_userid,人员信息中添加具体的userid,但是看了通知模板中的各种变量没有找到。

通知规则里,联系方式选择 feishu_userid,然后最终应该可以引用 {{ $sentos }}

@snailq
Copy link
Author

snailq commented Apr 25, 2025

计划添加一个联系方式:feishu_userid,人员信息中添加具体的userid,但是看了通知模板中的各种变量没有找到。

通知规则里,联系方式选择 feishu_userid,然后最终应该可以引用 {{ $sentos }}

已实现 感谢

@snailq snailq closed this as completed Apr 25, 2025
@snailq
Copy link
Author

snailq commented Apr 25, 2025

计划添加一个联系方式:feishu_userid,人员信息中添加具体的userid,但是看了通知模板中的各种变量没有找到。

通知规则里,联系方式选择 feishu_userid,然后最终应该可以引用 {{ $sentos }}

已实现 感谢
需要在通知媒介里配置,给后来人
单人通知:
{"msg_type": "interactive", "card": {"config": {"wide_screen_mode": true}, "header": {"title": {"content": "{{$tpl.title}}", "tag": "plain_text"}, "template": "{{if $event.IsRecovered}}turquoise{{else}}{{if eq $event.Severity 1}}red{{end}}{{if eq $event.Severity 2}}orange{{end}}{{if eq $event.Severity 3}}grey{{end}}{{end}}"}, "elements": [{"tag": "div", "text": {"tag": "lark_md","content": "{{$tpl.content}}\n{{if eq $event.Severity 1}}<at id={{$sendto}}></at>{{end}}"}}]}}
多人通知:
{"msg_type": "interactive", "card": {"config": {"wide_screen_mode": true}, "header": {"title": {"content": "{{$tpl.title}}", "tag": "plain_text"}, "template": "{{if $event.IsRecovered}}turquoise{{else}}{{if eq $event.Severity 1}}red{{end}}{{if eq $event.Severity 2}}orange{{end}}{{if eq $event.Severity 3}}grey{{end}}{{end}}"}, "elements": [{"tag": "div", "text": {"tag": "lark_md","content": "{{$tpl.content}}\n{{if eq $event.Severity 1}}{{range $i, $sendto := $sendtos}}<at id={{$sendto}}></at>{{end}}{{end}}"}}]}}

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants