管理 > 模块配置 > 参考 > 通知规则配置

通知规则配置

可以使用“模块”>“管理员”>“配置”选项卡 >“变更过程”>“变更流脚本”下的 change-flow.js 脚本中的 getUsersToNotify 函数定义以下项:

  • 发送通知的条件
  • 通知收件人
  • 通知消息的内容

启用后,默认情况下,getUsersToNotify 函数会指示 Release Control 将指定状态的每个新变更请求与以前收集的请求版本进行比较,并确定计算的风险是否超过指定的阈值。

function getUsersToNotify(prevChange, newChange, notificationContext) {

     return false;

/*

    var statusIsPendingApproval = (newChange.getField("status") ==

STATUS_PENDING_APPROVAL);

    

    var message = "";

    var riskStatusStr = "is ";

    

    var riskIncreased = true; // start by assuming risk increased (relevant to when the change first arrives)

    

    if (prevChange != null) {

        riskIncreased = (newChange.getField("calculated-risk") >

                  prevChange.getField("calculated-risk"));

        if (riskIncreased) {

            riskStatusStr = "has increased to ";

        }

    }

 

    var threshold = 0;

    var riskAboveThreshold = (newChange.getField("calculated-risk") > threshold);

有关风险计算的详细信息,请参阅风险分析

如果计算的风险确实超过了指定阈值,getUsersToNotify 函数的默认版本会指示 Release Control 通知与受影响的应用程序 (其影响严重性级别超过指定级别) 关联的所有用户。

if (statusIsPendingApproval && riskIncreased && riskAboveThreshold) {

    var message = "The current status of the request is " +

     newChange.getField("status").name +

     " and the calculated risk level of the request " +

     riskStatusStr +

     " " +

     newChange.getField("calculated-risk") +

     ".";

// Add affected users for this change request while Severity is greater than 0 (VERY_LOW).    

// To get all affected users send -1 on: newChange.getAffectedusers()

notificationContext.addUsers(newChange.getAffectedUsersAboveSeverity (SEVERITY_LOW));

if (notificationContext.hasUsers()) {// if there are users affected by this request, then notify them to check it out

message = "This request potentially affects one or more applications for which you are registered " +

"to receive notifications.\n" + message;

如果没有与这些应用程序关联的用户,则 getUsersToNotify 函数的默认版本会指示 Release Control 通知管理员。

} else {

    notificationContext.addUsersByRole("Administrator");

    message = "Change Control Management has not identified specific users that" +

     "will be notified regarding this request." +

     "You are receiving this notification due to your role" +

     "as a Change Control Management administrator.\n" +

     message;

    }

有关可在 getUsersToNotify 函数中使用的对象的说明,请参考 API_Reference.chm 文件中的 notificationContextGenericRFC 类。(要访问 API Reference,请选择“开始”>“程序”>“Release Control 9.60”>“Documentation”,然后打开 pdfs 目录)。