6.10 Notification, Notifier

Notification and Notifier definitions and definition examples are shown below. For details of Notification and Notifier, see “Designing notifications”.

The YAML definitions of Notification are as follows.

(Table) Notification definitions

Label Default value Required* Description
apiVersion: Yes API version
Specify 1.0.
kind: Yes Specify "notification".
type: No Specify "resource".
It indicates a new definition to be added to the operational function of Ops I.
name: Yes Internal name of the Notification definition.
"name" should follow the conventions shown below:
  • Specify the directory name of this YAML file.
  • The following characters can be entered:
    • Single-byte alphanumeric characters:
      a–z A–Z 0–9
    • Single-byte special characters:
      _ . ( ) -
  • The first character must be a single-byte alphanumeric character or an underscore (_).
  • For other precautions, see "Notes on creating YAML files" 2–4.
label: Yes Display name of the operational function to be written in the YAML file
includes: No List the related YAML files for use in this YAML file.
TipsTips
  • Before this YAML file is registered, the YAML file to be written to must be registered in Ops I.
  • By specifying the "includes" label, you can import information defined in another YAML file. For example, you can use this when importing a Notifier YAML file that defines notification methods.
- kind: Yes Type of YAML file to be loaded
  name: Yes Internal name of YAML file to be loaded
description: No Detailed description of this YAML file. This can be written using the template function.
event: Yes Event conditions for notification
  resource: Yes There are two roles as follows:
  • Resources targeted by the event (when the event type is not "onDemand")
    Specify the resources to be monitored for issuing notification events.
  • The starting point when embedding in notifications using ".Context" or ".PrevContext"
The following can be specified as resources:
  • schedule: Specify this when, for example, you want to send notifications for changes to the assignee of a schedule, reminders regarding a schedule, schedule changes related to recurring tasks, or workflow step transitions.
  • workitem: Specify this when, for example, you want to send notifications for the creation or update of a work item.
  • workflow: Specify this when, for example, you want to send notifications for the creation or completion of a workflow.
  type: Yes Event types
Configure the types of events for which notifications are to be issued.
  • update: Specify this when you want to receive notifications that a resource has been created or updated.
  • delete: Specify this when you want to receive notifications that a resource has been deleted.
  • time: Specify this when you want to receive notifications regarding periodic evaluations of resources.
    The target resources differ depending on the event resource (schedule, workitem, or workflow).
    • For schedule:
      • Schedules where the start date/time ("plannedStart") or end date/time ("plannedEnd") is within one week (10,080 minutes) of the current time.
      • Schedules for uncompleted workflow steps where the start date/time ("plannedStart") or end date/time ("plannedEnd") is set within one week (10,080 minutes) of the current time.
    • For workitem:
      "time" cannot be used.
    • For workflow:
      Uncompleted workflows.
  • onDemand: Specified for notifications using the workflow component "oi.notify".
For specification examples for "update", see "<Definition example> Notification". For "delete", see "<Definition example> Notifier (Work item deletion notification)". For "time", see "Use case 3: Notify of reminders 5 and 60 minutes before the start of the schedule".
"onDemand" can be specified when the event resource is a "workflow". For specification examples, see "Examples of workflow definitions including notifications".
conditions: No Describe the conditions for notification.
Do not specify this if the event type is "onDemand".
- No If there are multiple conditions, they will be judged using an "or" condition. Conditions for lower levels are judged using an "and" condition.
- resource: Yes Specify the object fields used to evaluate conditions. You can specify object fields that can be referenced from the resource specified in "event:.resource:".
In addition, the object field uses the notation ".Context" for the current value of the data being judged, and ".PrevContext" for the value before the change.
If the event type (type) is "update", the current value can be obtained with ".Context" and the value before the change can be obtained with ".PrevContext".
If the event type (type) is "delete", the value before deletion can be obtained with ".PrevContext", and ".Context" cannot be used.
If the event type ("type") is "time", ".Context" can be used, but ".PrevContext" cannot be used.
Example:
"{{ .GetValue ".Context.workflow.name" }}"
"{{ .GetValue ".PrevContext.status" }}"
For details about the object fields that can be used within the Notification definition, see "(Table) Object fields that can be used in Notification".
  <operator>: Yes Specify the operator and operand of the condition with <key>: <value>.
<key>
Specify the operator. The following types are available.
  • eq, ne (==, !=)
  • gt, ge (>, >=)
  • lt, le (<, <=)
  • in, notIn, wildcard, regex
  • remaining
    Can be specified only when the type is "time". In this case, specify a value between -10080 (7 days later) and 10080 (7 days earlier) as the fraction.
    Specify the date/time field as the "resource", and determine whether it is "value" minutes ago.
<value>
Specify the operand.
Example:
"eq: WorkflowNameAAA"
notifications: Yes List of notification objects to be sent
- message: Yes Notification object message to be sent
title: Yes Message title
It is also possible to embed fields starting from the object specified in the event condition ("event" part) of the notification. Note that only the current value (.Context) can be used. The value before the change (.PrevContext) cannot be used.
Example:
"There is an request for {{ .GetValue ".Context.activity" }}."
If the event type is "onDemand", you can retrieve values by specifying the parameters defined in the "params" section of "oi.notify" in the Workflow YAML file using the following syntax:
Example:
"{{ .OINotify.params.parameter }}"
body: Yes Body of the message.
It is also possible to embed fields starting from the object specified in the event condition ("event" part) of the notification.
Example:
"There is an request for {{ .GetValue ".Context.workflow.name" }}."
If the event type is "onDemand", you can retrieve the values of parameters specified in the "params" section of "oi.notify" in the Workflow YAML file using the following syntax:
Example:
"{{ .OINotify.params.parameter }}"
referTo: No Message reference.
It is also possible to embed fields starting from the object specified in the event condition ("event" part) of the notification.
When listing the URL for Ops I, check in advance that the user set as the recipient of the notification has access rights for the URL listed.
Example:
https://{{ .System.domain }}/sys_request/workflow_list/workflow_detail/{{ .GetValue ".Context.workflow" }}
If the event type is "onDemand", you can retrieve the value of a parameter specified in the "params" section of "oi.notify" in the Workflow YAML file using the following syntax:
Example:
"{{ .OINotify.params.parameter }}"
severity: Information No Notification severity
The following values can be used.
  • Critical
  • Warning
  • Information
destinations: Yes List of message recipients
The contents of a "message" object can be sent to multiple recipients.
- type: Yes Recipient type
Select from the following
  • user (to user)
  • group (to group)
  • groupMember (to members of a group)
  value: Yes Recipient value
It is also possible to embed fields starting from the object specified in the event condition ("event" part) of the notification. Note that only the current value (.Context) can be used. The value before the change (.PrevContext) cannot be used.
Example:
"{{ .GetValue ".Context.assignedGroup"}}"
If the event type is "onDemand", you can retrieve the value of a parameter specified in the "params" section of "oi.notify" in the Workflow YAML file using the following syntax:
Example:
"{{ .OINotify.params.parameter }}"
  notifiers: No Specify the means of notifying the recipient. Specify the "name" of the Notifier in an array.
For an example of specifying an array, see "<Definition example> Notifier (Work item deletion notification)".
TipsTips
Regardless of whether this parameter is specified, notifications via the Ops I GUI are executed.
*If a label that is not nested has its "Required" field set to "No", the definition is not required. For nested labels, the "Required" setting of a lower-level label applies only when the "Required" setting of its upper-level label is set to "Yes".

The object fields that can be used within the Notification definition are as follows.

(Table) Object fields that can be used in Notification

Object Field Data type*1 Output value Notes Conditions for retrieving values
workflow createdOn*3 Date*4 Workflow creation date and time - Always available
workflow updatedOn Date*4 Workflow update date and time - Always available
However, immediately after the workflow starts, the value is set to 1970/1/1 00:00:00. The updated value is retrieved when the workflow status changes or the workflow title is modified.
workflow createdBy*3 str User name of the workflow creator user object*2
To retrieve the user ID: "{{ .GetValue ".Context.createdBy"}}"
To retrieve the user name: "{{ .GetValue ".Context.createdBy.name"}}"
Always available
workflow id*3 uuid Workflow ID - Always available
workflow name str Workflow name The value of the "name" label in the Workflow YAML definition Always available
workflow schedule*3 uuid ID of the schedule directly associated with the workflow schedule object*2 Always available
workflow Any task name uuid ID of the schedule with the specified task name schedule object*2
You can specify any schedule that belongs to the workflow.
Always available
workflow title str Workflow title - Always available
workflow status*3 str Workflow status - Always available
workflow customer*3 str Customer ID customer object*2
To retrieve the customer ID: "{{ .GetValue ".Context.customer"}}"
To retrieve the customer name: "{{ .GetValue ".Context.customer.name"}}"
If the object is a workflow initiated by the customer user
workflow parentContext uuid ID of the parent workflow workflow object*2 In the case of a subflow
workflow rootContext uuid ID of the root workflow workflow object*2 Always available
workflow label str Label The value of the "label" label in the Workflow YAML definition.
It is output in the language specified in the hearing sheet.
Always available
workflow currentSchedule uuid ID of the currently running schedule (including those in the "Pending" state) schedule object*2
To reference the workflow assignee:
"{{workflow.currentSchedule.assignedTo.name}}"
To reference the workflow assigned group:
"{{workflow.currentSchedule.assignedGroup.name}}"
If a running schedule exists
workflow schedules.Any task name uuid ID of the schedule with the specified task name schedule object*2
You can specify any schedule that belongs to the workflow.
Always available
workflow description str Description - If set by the user*5
workflow category str Category - If set by the user*5
workflow dueDate Date*4 Due date - If set by the user*5
workflow note1 str Remarks - If set by the user*5
workflow note2 str Remarks 2 - If set by the user*5
workflow note3 str Remarks 3 - If set by the user*5
schedule id*3 uuid Schedule ID - Always available
schedule workflow Date*4 Workflow ID tied to a schedule workflow object*2 If the object is a schedule generated by a workflow initiation
schedule activity*3 str The name of the activity linked to the schedule - Always available
schedule parent*3 uuid ID of the parent schedule schedule object*2 If the object is a schedule for a workflow activity
schedule assignedTo*3 uuid ID of the assignee user user object*2
This field must be specified when notifying the agent for each step in the workflow or the agent for a schedule that is not linked to a calendar.
If the object is a schedule that meets any of the following conditions:   
  • A schedule generated by a workflow initiation and for which an assignee has been assigned
  • A schedule created from the [Resource] tab
schedule assignedGroup*3 uuid ID of the assignee group group object*2 If the object is a schedule that meets any of the following conditions:   
  • A schedule generated by a workflow initiation and for activities for which an assignee group has been assigned
  • A schedule created from the [Resource] tab with an assignee group assigned
schedule assignedUsers*3 uuid list A list of IDs of assigned users user object*2
This field must be specified when using the agent for the work item (multiple people can be specified) to send notifications.
If multiple items are specified, use a comma (,) to separate them.
When using in/notIn for the operator, the following evaluation is performed.
  • Whether the value specified in "value" matches/does not match any of the users in "assignedUsers"
  • Treats the values of "value" as being separated by commas, and checks whether any of the values of "value" match any of the values in "assignedUsers"
If the object is a schedule for a work item for which an assignee has been assigned
schedule status*3 str Schedule status For the value, see "Detailed API reference information > Standard API functions > Schemas > dtos.ScheduleDTO > status" in "JP1 Cloud Service/Operations Integration API Reference". Always available
schedule workflowStatus*3 str Status of the workflow activity tied to a schedule For the value, see "Detailed API reference information > Standard API functions > Schemas > dtos.ScheduleDTO > workflowStatus" in "JP1 Cloud Service/Operations Integration API Reference". If the object is a schedule for a workflow activity
schedule plannedStart*3 Date*4 Planned start date and time of the schedule - If the object is a schedule with a scheduled start date and time
schedule plannedEnd*3 Date*4 Planned end date and time of the schedule - If the object is a schedule with a scheduled end date and time
schedule calendar*3 uuid ID of the calendar to which the work item linked to the schedule belongs calendar object*2 If the object is a schedule for a work item
schedule title*3 str Schedule title - If the object is a schedule that meets any of the following conditions:
  • A schedule generated by a workflow initiation
  • A schedule created from the [Resource] tab
schedule scheduleType*3 str Schedule type The following values are set.
  • daily: Recurring work (daily)
  • weekly: Recurring work (weekly)
  • monthly: Recurring work (monthly)
  • yearly: Recurring work (yearly)
  • oneTime: Single work
  • on-demand: Schedule created at the start of a workflow
If the object is a schedule for a work item
schedule workitem*3 uuid ID of the related work item workitem object*2 If the object is a schedule for a work item
schedule canceled*3 bool Schedule deletion and restoration - If the object is a schedule for a work item
schedule changedFromWorkItemDefinition*3 bool Flag indicating changes since the work item was created - If the object is a schedule for a work item
user id uuid User ID - Always available
user name str Username - Always available
user email str User e-mail address - Always available
user number str Phone number - If the object is a user with a phone number set
user displayName str User display name The order of first and last names varies by language (Japanese/English). It follows the language specified in the hearing sheet. Always available
group id uuid Group ID - Always available
group name str Group name - Always available
group email str Group e-mail address - If the object is a group with an email address set
calendar id uuid Calendar ID - Always available
calendar name str Calendar name - Always available
calendar assignedGroups uuid list A list of IDs of assigned "group" group object*2
If multiple items are specified, use a comma (,) to separate them.
When using in/notIn for the operator, the following evaluation is performed.
  • Whether the value specified in "value" matches/does not match any of the "group" in "assignedGroups"
  • Treats the values of "value" as being separated by commas, and checks whether any of the values of "value" match any of the values in "assignedGroups"
Always available
workitem id*3 uuid Work item ID - Always available
workitem calendar*3 uuid Calendar ID calendar object*2 Always available
workitem name*3 str Work item name - Always available
workitem createdOn*3 Date*4 Work item creation date and time - Always available
workitem createdBy*3 uuid ID of the work item creator user object*2 Always available
workitem updatedOn Date*4 Work item update date and time - If the object's work items have been updated at least once
workitem updatedBy uuid ID of the work item updater user object*2 If the object's work items have been updated at least once
workitem workflowExecUser*3 uuid Workflow executor user object*2 If the object is a work item with automatic workflow execution configured for it
workitem assignedUsers*3 uuid list A list of IDs of assigned users user object*2
This field must be specified when using the agent for the work item (multiple people can be specified) to send notifications.
If multiple items are specified, use a comma (,) to separate them.
When using in/notIn for the operator, the following evaluation is performed.
  • Whether the value specified in "value" matches/does not match any of the "users" in "assignedUsers"
  • Treats the values of "value" as being separated by commas, and checks whether any of the values of "value" match any of the values in "assignedUsers"
If the object is a work item with an assignee assigned
workitem assignedGroup*3 uuid ID of the assignee group group object*2 If the object is a work item with an assigned group
workitem plannedStart*3 str Planned start time of the work item Format: HH:MM:SS Always available
workitem duration*3 int Planned duration of work item (minutes) - Always available
workitem scheduleType*3 str Schedule type The following values are set.
  • daily: Recurring work (daily)
  • weekly: Recurring work (weekly)
  • monthly: Recurring work (monthly)
  • yearly: Recurring work (yearly)
  • oneTime: Single work
Always available
workitem recurrenceNum*3 int Number of work item repetitions -
  • Always available if the object is a work item with a single task specified
  • If the object is a recurring work item with a specified number of occurrences
workitem startDate*4 str Start date of the work item Format: YYYY-MM-DD If the object is a work item with a start date specified
workitem endDate*3 str End date of the work item Format: YYYY-MM-DD If the object is a recurring work item with an end date specified
customer id str Customer ID - Always available
customer name str Customer name - Always available
*1: str represents the string type, uuid represents a string of UUID format, uuid list represents a list of strings in UUID format, Date represents the datetime type, int represents the integer type, and bool represents the Boolean type.
*2: You can output information about field-related objects.
Example: .Context.schedule.assignedTo
*3: When "event.type" is "update", a condition check is performed to notify when these values are changed. However, changes to information in related objects cannot be detected.
Also, when "event.type" is "update" or "delete", you can retrieve the values before the change by using ".PrevContext".
*4: The data types for dates and times differ between the "condition" section, which specifies the object serving as the starting point for the condition and the monitoring method, and the "message" section, which defines the content to be notified when the condition is met.
Item Format Example
condition section YYYY-MM-DDTHH:mm:ss±hh:mm 2025-01-02T03:04:05+09:00
message section YYYY-MM-DD HH:mm:ss time zone 2025-01-02 03:04:05 JST
*5: This value can be retrieved if you add a column to the workflow list and set a value for it. For details, see "Customizing the workflow window".

The YAML definitions of Notifier are as follows.

(Table) Notifier definitions

Label Default value Required* Description
apiVersion: Yes API version
Specify 1.0.
kind: Yes Specify "notifier"
type: No Specify "resource".
It indicates a new definition to be added to the operational function of Ops I.
name: Yes Internal name of the Notifier definition.
"name" should follow the conventions shown below:
  • Specify the directory name of this YAML file.
  • The following characters can be entered:
    • Single-byte alphanumeric characters:
      a-z A-Z 0-9
    • Single-byte special characters:
      _ . ( ) -
  • The first character must be a single-byte alphanumeric character or an underscore (_).
  • For other precautions, see "Notes on creating YAML files" 2-4.
label: Yes Display name of the operational function to be written in the YAML file
includes: No List the related YAML files for use in this YAML file.
TipsTips
  • Before this YAML file is registered, the YAML file to be written to must be registered in Ops I.
  • By specifying the "includes" label, you can import information defined in another YAML file.
- kind: Yes Type of YAML file to be loaded
  name: Yes Internal name of YAML file to be loaded
description: No Detailed description of this YAML file
protocol: Yes Protocol used for the notification method
The following protocols can be used.
  • smtp
property: Yes smtp properties
credential: Yes Authentication information for the SMTP server.
Fixed "default"
url: Yes SMTP server address
Fixed "email-smtp.ap-northeast-1.amazonaws.com"
port: Yes SMTP server port.
Fixed "587"
to: Yes Specify the recipient email address. The notification email is sent with the specified email address in the Bcc header.
To send to multiple recipients, separate email addresses with commas (,).
By embedding fields from objects included in the notification, you can include the content displayed on the GUI in the email notification as well. To specify this, concatenate the object and field you want to embed in ".Context".
See "(Table) Object fields that can be used in Notifier" for object fields that can be used in Notifier.
Example:
{{ .Context.receiver.email }}
from: No The SMTP sender address.
Fixed "noreply@ops-integration.com"
subject: No The e-mail title.
By embedding fields from objects contained in a notification, you can include the content displayed on the GUI in the email notification as well. To specify this, concatenate the object and field you want to embed in ".Context".
See "(Table) Object fields that can be used in Notifier" for object fields that can be used in Notifier.
Example:
{{ .Context.message.title }}
message: No The e-mail body.
By embedding fields from objects contained in a notification, you can include the content displayed on the GUI in the email notification as well. To specify this, concatenate the object and field you want to embed in ".Context".
See "(Table) Object fields that can be used in Notifier" for object fields that can be used in Notifier.
Example:
{{ .Context.message.body }}
conditions: No If the conditions of this definition are met, notifications will be sent using this Notifier.
- No If there are multiple conditions, they will be judged using an "or" condition. Conditions for lower levels are judged using an "and" condition.
- resource: Yes Prerequisites
You can also embed fields from objects contained in a notification. To specify this, concatenate the object and field you want to embed in ".Context".
See "(Table) Object fields that can be used in Notifier" for object fields that can be used in Notifier.
Example:
{{ .Context.receiver.email }}
  <operator>: Yes Specify the operator and operand of the condition with <key>: <value>.
<key>
Specify the operator. The following types are available.
  • eq, ne (==, !=)
  • gt, ge (>, >=)
  • lt, le (<, <=)
  • in, notIn, wildcard, regex
<value>
  Specify the operand.
  Example:
  regex: ^∗@hitachi.com$
*If a label that is not nested has its "Required" field set to "No", the definition is not required. For nested labels, the "Required" setting of a lower-level label applies only when the "Required" setting of its upper-level label is set to "Yes".

The object fields that can be used within the Notifier definition are as follows.

(Table) Object fields that can be used in Notifier

Object Field Description
message title Message title
message severity Message severity
message body Message content
message referTo Message reference
receiver email Destination e-mail address

<Definition example> Notification

apiVersion: 1.0
kind: notification

## Meta data
type: resource
name: lend_reject_notification
label: lend_reject_notification
description: A YAML definition that sends a rejection notice to the requester.

## Notification contents
event:
  resource: schedule
  type: update
conditions:
  -
    - resource: '{{ .GetValue ".Context.activity" }}'
      eq: create_vm_wf_04

    - resource: '{{ .GetValue ".Context.workflowStatus" }}'
      eq: pending

    - resource: '{{ .GetValue ".PrevContext.workflowStatus" }}'
      eq: succeeded

notifications:
  - message:
      title: VM lending rejection notice
      body: |
             A notice of rejection for the VM lending has been received. Please check the information provided and take the appropriate action.
              Date and time of application:{{ .GetValue ".Context.createdOn" }}
              Requester:{{ .GetValue ".Context.createdBy" }}
      referTo: https://{{ .System.domain }}/sys_request/workflow_list/workflow_detail/{{ .GetValue ".Context.workflow" }}
      severity: Information
    destinations:
      - type: user
        value: '{{ .GetValue ".Context.createdBy" }}'

<Definition example> Notifier

apiVersion: 1.0
kind: notifier

## Meta data
type: resource
name: email
label: Normal case
description: Normal case

protocol: smtp
property:
  credential: default
  url: email-smtp.ap-northeast-1.amazonaws.com
  port: 587
  to: '{{ .Context.receiver.email }}'
  from: noreply@ops-integration.com
  subject: '{{ .Context.message.title }}'
  message: |
    {{ .Context.message.body }}

<Definition example> Notifier (Work item deletion notification)

apiVersion: 1.0
kind: notification

## Meta data
type: resource
name: workitem_notification
label: workitem_notification
description: |
  Work item deletion notification

## Notification contents
event:
  resource: workitem
  type: delete

notifications:
  - message:
      title: '[{{ .GetValue ".PrevContext.name" }}] has been deleted.'
      body: |
            work item "{{ .GetValue ".PrevContext.name" }}" has been deleted.
      severity: Information
    destinations:
      - type: user
        value: '{{ .GetValue ".PrevContext.assignedUsers" }}'
        notifiers:
          - email