diff --git a/framework/sdk-parent/sdk/src/main/java/io/metersphere/notice/sender/AbstractNoticeSender.java b/framework/sdk-parent/sdk/src/main/java/io/metersphere/notice/sender/AbstractNoticeSender.java index 87414635a3..d77e77b977 100644 --- a/framework/sdk-parent/sdk/src/main/java/io/metersphere/notice/sender/AbstractNoticeSender.java +++ b/framework/sdk-parent/sdk/src/main/java/io/metersphere/notice/sender/AbstractNoticeSender.java @@ -57,6 +57,17 @@ public abstract class AbstractNoticeSender implements NoticeSender { // 处理 userIds 中包含的特殊值 noticeModel.setReceivers(getRealUserIds(messageDetail, noticeModel, messageDetail.getEvent())); + //apiReceiver特殊处理 + String apiSpecialType = (String) noticeModel.getParamMap().get("apiSpecialType"); + if (apiSpecialType != null && apiSpecialType.equals("API_SPECIAL")) { + String specialReceivers = (String) noticeModel.getParamMap().get("specialReceivers"); + List list = JSON.parseArray(specialReceivers); + if (CollectionUtils.isNotEmpty(list)) { + for (Object o : list) { + noticeModel.getReceivers().add(new Receiver(o.toString(), NotificationConstants.Type.MENTIONED_ME.name())); + } + } + } // 如果配置了模版就直接使用模版 if (StringUtils.isNotBlank(messageDetail.getTemplate())) {