EmailPlus has global scripts functions that you can use
to create EmailPlusRule advanced rules.
- OneOf($list, $item)
- Searches an array of string values for the presence of the specified
item. The $list parameter is a reference to an
array. The $item parameter is a string. The function
returns TRUE if the item is found, or else it returns FALSE. The following
example returns 1 or TRUE because the string value2 is in the
array: OneOf( ['value1', 'value2', 'value3'], 'value2' )
- Gfv($fieldName)
- Simple encapsulation of the IBM Rational ClearQuest API call GetFieldValue,
which is equivalent to this statement: GetFieldValue($fieldName)->GetValue().
- Gfov($fieldName)
- Simple encapsulation of the ClearQuest API call GetFieldOriginalValue,
which returns the original value of a field before changes were made.
- Gfvs($fieldName)
- Simple encapsulation of the ClearQuest API call GetFieldValueStatus,
which is equivalent to this statement: GetFieldValue($fieldName)->GetValueStatus().
- FChg($list)
- Evaluates all of the fields defined in the $list parameter
to identify if any of the field values have changed. It returns ANY
if one or more field values have changed. It returns ALL if all field
values have changed. It returns NONE if none of the field values have
changed. The
$list parameter is a reference to an array.
- StoDT($dateString)
- Converts a date string value in the “YYYY-MM-DD hh:mm:ss” format
from a ClearQuest DATE_TIME field to a UTC date-time expression in
seconds. The return value is the number of non-leap seconds since
the epoch. On most systems the epoch is 00:00:00 UTC, January 1, 1970.
- DTtoS($timestamp)
- Converts a UTC date-time expression in seconds into a date string
in the YYYY-MM-DD hh:mm:ss format.
- EMP_ReFormatDateString($dateString, $template, $timezone)
- Converts a ClearQuest DATE_TIME field from the YYYY-MM-DD hh:mm:ss
format to a format of your choice. The $template parameter
is a template that is defined using the LC_TIME categories of the
program’s locale, for example “%d-%m-%Y %H:%M:%S”. The optional $timezone parameter
defines the timezone. If no timezone is defined, the default timezone
of the host that sends the notification is used. If the value of the
date string that is passed to this function is empty, an empty string
is returned. This function utilizes the Date::Format Perl module that
is included with CQPerl, for example:
#@EXPRESSION::EMP_ReFormatDateString(
Gfv("DueDate"), "%d-%m-%Y %H:%M:%S", "UTC" );@#
This
example generates the date in the ctime format: #@EXPRESSION::EMP_ReFormatDateString(
Gfv("DueDate"), "%C", "UTC" );@#.