Back to index
Summary
Create an EmailNotifier on a property sheet container specified by an emailNotifierSelector.
You must specify a notifierName and object locators for a job, job step, procedure, or procedure step.
|
notifierNameStringrequiredThe name of the email notifier. applicationNameStringoptionalThe name of the application which is related to the target email container (Process/ProcessStep). componentNameStringoptionalThe name of the component which is related to the target email container (Process/ProcessStep). conditionStringoptionalA fixed text or text embedding property references that is evaluated into a logical TRUE or FALSE. An empty string, a 0 or false is interpreted as FALSE. Any other result string is interpreted as TRUE.configNameStringoptionalName for an email configuration; or a text that - through property expansion - results into such an email configuration name. descriptionStringoptionalComment text describing this object that is not interpreted at all by CloudBees CD/RO. destinationsStringoptionalA list of space-separated user names, email addresses or email aliases or a text that - through property expansion - results into such a list. environmentNameArrayoptionalName of the environments. eventTypeStringoptionalAn enumeration of valid event categories recognized by the email notifiers. Possible values: "onCompletion" , "onEnter" , "onStart" , "onWaitOnError" flowNameStringoptionalThe name of the flow container of the email notifier. flowRuntimeIdUUIDoptionalThe primary key or name of the flowRuntime container of the email notifier. flowRuntimeStateIdUUIDoptionalThe primary key or name of the flowRuntimeState container of the email notifier. flowStateNameStringoptionalThe name of the flow container of the email notifier. formattingTemplateStringoptionalString containing email formatting instructions for generating notifications. gateTypeStringoptionalThe type of the gate. Possible values: "POST" , "PRE" groupNameArrayoptionalA list of names of the groups which receives the notification. jobIdStringoptionalThe primary key or name of the job container of the email notifier. jobStepIdUUIDoptionalThe primary key of the job-step container of the email notifier. notificationTypeStringoptionalThe notification type which will be stored to the ec_notificationType property. Possible values: "always" , "failure" , "success" pipelineNameStringoptionalThe name of the pipeline container of the email notifier. procedureNameStringoptionalThe name of the procedure container of the email notifier. processNameStringoptionalThe name of the process container of the email notifier. processStepNameStringoptionalThe name of the process step container of the email notifier. projectNameStringoptionalThe name of the project container of the email notifier. releaseNameStringoptionalThe name of the release containing the pipeline. stageNameStringoptionalThe name of the stage container of the email notifier. stateDefinitionNameStringoptionalThe name of the state definition container of the email notifier. stateNameStringoptionalThe name of the state container of the email notifier. stepNameStringoptionalThe name of the step container of the email notifier. userNameArrayoptionalA list of names of the users who receives the notification. workflowDefinitionNameStringoptionalThe name of the workflow definition container of the email notifier. workflowNameStringoptionalThe name of the workflow container of the email notifier. |
Usage
Perl
$cmdr->createEmailNotifier( "test-notifierName" # notifierName # optionals );
ectool
ectool createEmailNotifier \ "test-notifierName" `# notifierName` \ # optionals
Examples
Perl
$cmdr->createEmailNotifier("testNotifier", {eventType => "onStart", condition => "$[/javascript if(myJobStep.outcome == 'warning') 'true'; else 'false';]", destinations => 'user1@abc.com user2@abc.com emailAlias1@example.com', configName => "testConfiguration", projectName => "Project_test", procedureName => "Procedure_test", formattingTemplate => "Subject: Job started Notification: Job: $[/myJob/jobName] $[/myEvent/type] Job: $[/myJob/jobName] $[/myEvent/type] at $[/myEvent/time]",});
ectool
ectool createEmailNotifier testNotifier --condition "$[/javascript if(myJobStep.outcome == 'warning') 'true'; else 'false';]" --destinations "user1@abc.com user2@abc.com emailAlias1@example.com" --configName EmailConfig_test --formattingTemplate "Notification: Job: $[/myJob/jobName] $[/myEvent/type] Job: $[/myJob/jobName] $[/myEvent/type] at $[/myEvent/time]" --projectName Project_test --procedureName Procedure_test --description "This is a test email notifier for Job completion"