Amministrazione > Configurazione dei moduli > Riferimenti > Configurazione della regola di notifica

Configurazione della regola di notifica

Si utilizza la funzione getUsersToNotify nello script change-flow.js situato in Moduli > Amministratore > scheda Configurazione > Processo cambiamento > Script flusso cambiamento per definire quanto segue:

  • Le circostanze in cui devono essere inviate le notifiche
  • I destinatari delle notifiche
  • Il contenuto dei messaggi di notifica

Se abilitata, la funzione getUsersToNotify specifica per impostazione predefinita a Release Control di confrontare ciascuna nuova richiesta di change di uno stato specificato con la versione della richiesta precedentemente raccolta e stabilire se il rischio calcolato è aumentato oltre una soglia specificata.

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);

per informazioni sui calcoli di rischio, vedere Analisi del rischio.

Se il rischio calcolato è aumentato oltre la soglia specificata, la versione predefinita della funzione getUsersToNotify specifica a Release Control di notificare tutti gli utenti associati alle applicazioni interessate il cui livello di gravità dell'impatto ha superato il livello specificato.

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;

Se non vi sono utenti associati a queste applicazioni, la versione predefinita della funzione getUsersToNotify specifica a Release Control di notificare l'amministratore.

} 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;

    }

Per una spiegazione degli oggetti che possono essere utilizzati nella funzione getUsersToNotify, fare riferimento alle classi notificationContext e GenericRFC nel file API_Reference.chm. Per accedere alla guida API Reference (in inglese), selezionare Start > Programmi > Release Control 9.60 > Documentation, quindi aprire la directory pdfs.