Administration du serveur > Calculations in Fields, Charts, and Reports > Computed Expression Function Classes
  
Computed Expression Function Classes
In a computed expression, you can use the following function classes to perform calculations:
Arithmetic Functions
An arithmetic function can be applied in any computed expression type to perform basic arithmetic calculations. For example, adding two field values and rounding the resulting value to the nearest integer.
For a complete list of arithmetic functions, see Arithmetic Functions.
Date/Time Functions
A date/time function is used to return or quantify date/time information. For example, the number of days an item spends in a specific state, or the earliest date/time recorded against an item.
For a complete list of date/time functions, see Date/Time Functions.
Aggregate Functions
An aggregate function is used to perform aggregate calculations of item data. For example, using the sum function to add the field values in a list of items. Attempting to use an aggregate function for a normal expression results in an error.
For a complete list of aggregate functions, see Aggregate Functions.
Text Functions
A text function is used to perform calculations with text and numeric fields to provide a text/numeric value. For example, using an item’s ID to create a computed field that calculates a unique identifier for an item, such as REQ-00001234. String expressions in text functions accept short and long text fields.
For a complete list of text functions, see Text Functions.
External Information Functions
An external information function operates against a single item and extracts metric information from the item. For example, how many times the item has been in the Submit state. Attempting to use an external information function in an aggregate expression results in an error. For example, SICPEntryCount() is an invalid aggregate expression, but sum(SICPEntryCount()) is valid because the argument to an aggregate function is a normal expression. SICPEntryCount() is part of the normal expression and is therefore valid.
For example, it is valid to use DaysInState() when accessing a single item because it results in a single number. However, if you use it against a list of items, no results can be returned. To apply an external information function to each item in a list, you must embed it in an aggregate function. For example, avg(DaysInState()).
For a complete list of external information functions, see External Information Functions.
Item Information Functions
An item information function is used to return basic information about an item type. For example, if an item type has a test management role of Test Case, a true or false value is returned.
For a complete list of item information functions, see Item Information Functions.
Test Functions
A test function is used to return information about test results. For example, return the numeric verdict type value for a given verdict ID.
For a complete list of test functions, see Test Functions.
Key Considerations
All fields return values specific to their field type. However, picklist fields return their numeric (non-textual) values. For example, getFieldValue (567, Priority) displays 1 as the field value for Priority=High for Defect 567.
Node, segment, shared item, and test types are used by the document model.
If document versioning is enabled, computed expressions return all items (live and versioned) by default. To specify live or versioned items, include the IsLive() or IsVersioned() function.
Text strings in text calculations cannot exceed 1 kilobyte. Exceeding this limit can cause the Windchill RV&S server to fail.
Arithmetic Functions
Name and Description
Return Value
abs(numeric-expression)
Returns absolute value of numeric expression.
Integer or floating point
(same as expression)
sign(numeric-expression)
Returns -1 if expression evaluates to < 0, 0 if it evaluates to 0, and +1 if it evaluates to a positive number.
Integer or floating point
(same as expression)
round(numeric-expression)
Returns expression rounded to nearest integer.
Integer
truncate(numeric-expression)
Returns expression truncated to nearest integer.
Integer
floor(numeric-expression)
Returns largest integer less than or equal to given numeric expression.
Integer
ceil(numeric-expression)
Returns smallest integer greater than or equal to given numeric expression.
Integer
mod(numeric-expression1, numeric-expression2)
Returns remainder of first expression divided by second expression.
If either expression is not an integer, then the expression is:
(abs(e1) - floor(abs(e1)/abs(e2)) * abs(e2)) * sign(e1)
Integer if both expressions integers; otherwise, floating point
isEmpty(expression1, expression2)
The first expression evaluated. If the result is not empty, it becomes the return value for the function. If the result is empty, the second expression is evaluated and is the return value for the function. Both expressions must evaluate to the same type. The expression can be numeric, time, or Boolean.
Type in expression
emptyint()
Returns an empty value in an integer field.
none
emptyfloat()
Returns an empty value in a floating point field.
none
emptytime()
Returns an empty value in a date/time field.
none
emptydate()
Returns an empty value in a date field.
none
emptylogical()
Returns an empty value in a logical field.
none
emptytext()
Returns an empty value in a text field.
none
emptyuser()
Returns an empty value in a user field.
none
emptygroup()
Returns an empty value in a group field.
none
timestamp(quoted-string)
Converts the supplied string into timestamp constant. Using Java SimpleDateFormat, the following formats are attempted in order until one succeeds:
Java DateTimeInstance(LONG, LONG)
Java DateTimeInstance(SHORT, SHORT)
MMM d, yyyy hh:mm a
MMM d, yyyy HH:mm
MMM d, yyyy HH:mm:ss
* 
Parsing is done on the client using the client's locale. The timestamp is evaluated into timestamp constant during parsing. When the expression is displayed, it is shown in the standard format for the locale.
Timestamp
now()
Returns current time.
* 
Current time is time when the expression evaluated is not parsed. To return the number of days an item has existed, type:
now() - "Created Date"
Timestamp
SelectionCount(field-name)
Returns the number of entries selected in a multi-valued field on an item. If the field is empty, returns 0; if the field is not empty but is not multi-valued, returns 1.
Not valid for attachment, relationship, or computed fields.
Integer
Date/Time Functions
Name and Description
Return Value
DateDiff(date/time field1, date/time field2)
Returns number of seconds between two date/time fields. If date/time field1 is larger than date/time field2, the result is positive. Otherwise, the result is negative.
By including the dateFirstEntered function, you can calculate the number of seconds to close an Incident item. For example, DateDiff(dateFirstEntered(“Closed”), “Created Date”).
* 
To correctly calculate the expression, the Include Time option must be enabled in each specified date/time field.
Integer
DaysInState(state-name)
Returns the number of days item in the specific state rounded to the nearest day. Individual state times are added together in seconds. The resulting sum is rounded to days.
To specify the unspecified state, type "Unspecified". For example, DaysInState("Unspecified").
Integer
DaysInPhase(phase field name, phase name)
Returns the number of days the item is in the specific phase rounded to the nearest day. Individual phase times are added together in seconds. The resulting sum is rounded to days.
Integer
DaysCurrentState()
Returns the number of days the item is in current state rounded to the nearest day.
Integer
DayOfYear(date/timestamp/field)
Returns the day of the year for the specified date.
Integer
dayOfWeek(date/timestamp/field)
Returns the day of the week for the specified date. Sunday is 1, Monday is 2, and so on.
Integer
weekOfYear(date/timestamp/field)
Returns the week of the year for the specified date.
* 
Windchill RV&S does not support ISO-8601 for calendar weeks. Therefore, the returned calendar week is always one number higher than expected. For example, for the year 2010 in Windchill RV&S, calendar week 1 begins on January 1, 2010. In ISO-8601, calendar week 1 begins on January 4, 2010.
Integer
monthOfYear(date/timestamp/field)
Returns the month of the year for the specified date.
Integer
weeksDiff(dateA, dateB)
Returns the number of weeks between two specified dates.
* 
This is the number of actual weeks, not the number of days divided by 7.
Integer
monthsDiff(dateA, dateB)
Returns the number of months between two specified dates.
* 
This is the number of actual months, not the number of days divided by 30.
Integer
weekdaysDiff(dateA, dateB)
Returns the number of weekdays between two specified dates. Saturdays and Sundays are not included.
Integer
DayOfWeekName(date/timestamp)
Returns the day of week for the specified date or date and time. For example, Monday.
Text
getDay(date/timestamp/field)
Returns the date for the specified date or date and time. For example, 23.
Integer
getYear(date/timestamp/field)
Returns the date for the specified date or date and time. For example, 2009.
Integer
MonthOfYearName(date/timestamp/field)
Returns the month of the year for the specified date or date and time. For example, October.
Text
getHour(timestamp/field)
Returns the hour for the specified time. For example, 2.
* 
Hours are specified in 24-hour time. For example, midnight is 0 and 7pm is 19.
Integer
getMinute(timestamp/field)
Returns the minute for the specified time. For example, 05.
Integer
getSecond(timestamp/field)
Returns the second for the specified time. For example, 33.
Integer
DaysCurrentPhase(phase-field-name)
Returns the number of days that the item is in the current phase rounded to the nearest day.
Integer
dateFirstEntered(state-name)
Returns the date that the specified state was first entered.
Timestamp
dateLastEntered(state-name)
Returns the date that the specified state was last entered.
Timestamp
SecondsInState
Returns the number of seconds that the item is in the specific state. If an item is in a state multiple times, the seconds for each occurrence are added together.
To specify the unspecified state, type "Unspecified". For example, SecondsInState("Unspecified").
Integer
SecondsInPhase
Returns the number of seconds that the item is in the specific phase. If item is in the phase multiple times, the seconds for each occurrence are added together.
To specify unspecified phase, type "Unspecified", for example, SecondsInPhase("Unspecified").
Integer
SecondsCurrentState
Returns the number of seconds that the item is in the current state.
Integer
SecondsCurrentPhase
Returns the number of seconds that the item is in the current phase.
Integer
sumTimeEntry[(date("startdate"),date("enddate"))]
or
sumTimeEntry[(symbolicdate(),symbolicdate())]
Returns the total time (rounded to the hour) spent on the item in the optional timeframe.
Integer
sumTimeEntryByUser(user[,user...][,date("startdate"),date("enddate")]
or
sumTimeEntryByUser(user[,user...][,symbolicdate(),symbolicdate()]
Returns the total time (rounded to the hour) spent on the item by specified users in the optional timeframe.
Integer
sumTimeEntryByGroup(group[,group...][,date("startdate"),date("enddate")])
or
sumTimeEntryByGroup(group[,group...][,symbolicdate(),symbolicdate()])
Returns the total time (rounded to the hour) spent on the item by specified groups in the optional timeframe.
Integer
sumTimeEntryByPhase(phaseField, phase[,date("startdate"),date("enddate")])
or
sumTimeEntryByPhase(phaseField, phase[,symbolicdate(),symbolicdate()])
Returns the total time (rounded to the hour) spent on the item while in the phase for the specified phase field.
Integer
sumTimeEntryByPhaseByUser(phaseField, phase, user[,user...][,date("startdate"),date("enddate")])
or
sumTimeEntryByPhaseByUser(phaseField, phase, user[,user...][,symbolicdate(),symbolicdate()])
Returns the total time (rounded to the hour) spent on the item by specified users while in the phase for the specified phase field.
Integer
sumTimeEntryByPhaseByGroup(phaseField, phase, group[,group...][,date("startdate"),date("enddate")])
or
sumTimeEntryByPhaseByGroup(phaseField, phase, group[,group...][,symbolicdate(),symbolicdate()])
Returns the total time spent (rounded to the hour) on the item by specified groups while in the phase for the specified phase field.
Integer
sumTimeEntryByState(state[,date("startdate"), date("enddate")])
or
sumTimeEntryByState(state[,symbolicdate(), symbolicdate()])
Returns the total time spent (rounded to the hour) on the item while in the specified state.
* 
Windchill RV&S gathers time entries on a daily basis and assigns the time entry to the date (to midnight). Windchill RV&S records state changes to the exact millisecond. Using time entries to determine how long an item has been in a particular state is only an approximation. Therefore, this function is only guaranteed to be correct if the item contains only one state transition for the entire day.
For example, an item is posted, moves through several states (Investigate, In Development , Development Done), and is closed (Built) in a single day. Then, the user working on the item enters the total time spent on the item in a time entry. Because Windchill RV&S cannot subdivide this time entry (hours spent on the item) into multiple pieces of information (hours spent in each state), the sumTimeEntryByState function assigns the time entry to a single state: the state that the item had on midnight on the day of the entry (Built).
To specify the unspecified state, type "Unspecified". For example, sumTimeEntryByState("Unspecified").
Integer
sumTimeEntryByStateByUser(state, user[,date("startdate"),date("enddate")])
or
sumTimeEntryByStateByUser(state (user[,symbolicdate(),symbolicdate()])
Returns the total time spent (rounded to the hour) on the item by specified users while in the specified state.
Integer
sumTimeEntryByStateByGroup(state, group[,date("startdate"),date("enddate")])
or
sumTimeEntryByStateByGroup(state, group[,symbolicdate(),symbolicdate()])
Returns the total time spent (rounded to the hour) on the item by specified groups while in the specified state.
Integer
countTimeEntry(date("startdate"), date("enddate"))
or
countTimeEntry(symbolicdate(),symbolicdate())
Returns the number of time entries for the item with a duration greater than zero in the optional timeframe.
Integer
countTimeEntryByUser(user[,user...] [,date("startdate"),date("enddate")])
or
countTimeEntryByUser(user[,user...] [,symbolicdate(),symbolicdate()])
Returns the number of time entries for the item by specified users with a duration greater than zero in the optional timeframe.
Integer
countTimeEntryByGroup(group[,group...] [,date("startdate"),date("enddate")])
or
countTimeEntryByGroup(group[,group...] [,symbolicdate(),symbolicdate()])
Returns the number of time entries for the item by specified groups with a duration greater than zero in the optional timeframe.
Integer
firstTimeEntryDate()
Returns the earliest date time is recorded against the item.
Date
lastTimeEntryDate()
Returns the latest date time is recorded against the item.
Date
Aggregate Functions
Name and Description
Return Value
sum(numeric-expression)
Adds expressions calculated against each item that the aggregation runs against.
Integer or floating point, same as expression
avg(numeric-expression)
Adds expressions calculated against each item that the aggregation runs against and then divides by number of non-empty entries.
Floating point
min(numeric-expression or timestamp)
Finds the smallest of expressions from each item that the aggregation runs against. If all expressions are empty, the result is empty.
Integer, float point, or timestamp same as expression
max(numeric-expression or timestamp)
Finds the largest of the expressions from each item that the aggregation runs against. If all expressions are empty, the result is empty.
Integer, floating point, or timestamp same as expression
count()
Returns the number of items that the aggregation is run against.
Integer
sumTimeEntrySecs[(date("startdate"),date("enddate"))]
or
sumTimeEntrySecs[(symbolicdate(),symbolicdate())]
Returns the total time spent (in seconds) on an item in an optional timeframe.
Integer
sumTimeEntrySecsByUser(user[,user...][,date("startdate"),date("enddate")]
or
sumTimeEntrySecsByUser(user[,user...][,symbolicdate(),symbolicdate()]
Returns the total time spent (in seconds) on an item by specified users in an optional timeframe.
Integer
sumTimeEntrySecsByGroup(group[,group...][,date("startdate"),date("enddate")])
or
sumTimeEntrySecsByGroup(group[,group...][,symbolicdate(),symbolicdate()])
Returns the total time spent (in seconds) on an item by specified groups in an optional timeframe.
Integer
sumTimeEntrySecsByState(state[,date("startdate"),date("enddate")])
or
sumTimeEntrySecsByState(state[,symbolicdate(),symbolicdate()])
Returns the total time spent (in seconds) on an item while in the specified state.
Integer
sumTimeEntrySecsByStateByUser(state, user[,date("startdate"),date("enddate")])
or
sumTimeEntrySecsByStateByUser(state (user[,symbolicdate(),symbolicdate()])
Returns the total time spent (in seconds) on an item by specified users while in the specified state.
Integer
sumTimeEntrySecsByStateByGroup(state, group[,date("startdate"),date("enddate")])
or
sumTimeEntrySecsByStateByGroup(state, group[,symbolicdate(),symbolicdate()])
Returns the total time spent (in seconds) on an item by specified groups while in the specified state.
Integer
sumTimeEntrySecsByPhase(phaseField, phase[,date("startdate"),date("enddate")])
or
sumTimeEntrySecsByPhase(phaseField, phase[,symbolicdate(),symbolicdate()])
Returns the total time spent (in seconds) on an item while in the phase for the specified phase.
Integer
sumTimeEntrySecsByPhaseByUser(phaseField, phase, user[,user...][,date("startdate"),date("enddate")])
or
sumTimeEntrySecsByPhaseByUser(phaseField, phase, user[,user...][,symbolicdate(),symbolicdate()])
Returns the total time spent (in seconds) on an item by specified users while in the phase for the specified phase.
Integer
sumTimeEntrySecsByPhaseByGroup(phaseField, phase, group[,group...][,date("startdate"), date("enddate")])
or
sumTimeEntrySecsByPhaseByGroup(phaseField, phase, group[,group...][,symbolicdate(),symbolicdate()])
Returns the total time spent (in seconds) on an item by specified groups while in the phase for the specified phase.
Integer
LastResultAgg()
Returns the internal ID of the most recent test result record for a group of items. This function must be used with the Aggregate, AggregateByTree, or Query function. For example, AggregateByTree (LastResultAgg()). This function must be used with the TestVerdictName function to convert the internal ID to a display string. For example, TestVerdictName(LastResultAgg()).
Integer
Text Functions
Name and Description
Return Value
Text(string)
Creates text constant.
* 
If the string does not contain special characters, quotes are not required. For example, text("REQ") and text(REQ) are identified as the same string.
Text
Length(string-expression)
Returns the length of the string.
Integer
Upper(string-expression)
Converts the string into uppercase.
Text
Lower(string-expression)
Converts the string into lowercase.
Text
Concat(string-expression, string-expression[, ...])
Concatenates two or more strings.
Text
Substring(string-expression, start, count)
Takes the substring of the string. The substring starts at first character and goes for the count characters. start offset is origin 1. start and count must be positive integer constants.
The following conditions return empty strings:
start less than or equal zero.
start greater than length of string being processed.
count less than zero.
If start plus length is greater than the length of string being processed, then it returns from the start to the end of string. There is no padding with blanks.
Text
Locate(string-expression, string-expression)
Searches for the first string in a second string.
To add startsWith, type Locate(x, y) == 1.
Value offset into second string first string found, where if the second string starts with the first string, the value is one (1). If it is not found, a zero (0) is returned.
Integer
Trim(string-expression)
Removes leading and trailing spaces from the string.
Text
LTrim(string-expression)
Removes leading spaces from the string.
Text
RTrim(string-expression)
Removes trailing spaces from the string.
Text
ToText(number-expression)
Converts a number to a string.
Text
ToTextZeroPad(number-expression, size)
Converts a number to a string with zero padding.
size must be positive integer constant.
If the formatted size of the number is greater than or equal to the specified size, it returns unchanged. Otherwise, it is padded on left with the zero (0) character. If the number is negative, a negative sign (-) is the first character.
Text
External Information Functions
Name and Description
Return Value
SICPCount([cpstate, ...])
Returns the number of change packages associated with an item. Specify one or more of following change package states to include in the count:
Closed
Open
Submitted
Accepted
Rejected
Discarded
CommitFailed
If you do not specify any arguments, the count of all change packages is returned.
Integer
SICPEntryCount([cpentrytype, ...])
Returns the number of change package entries associated with an item. Specify one or more of following change package entry types to include in the count:
Update
Add
Drop
Lock
RenameFrom
RenameTo
UpdateRevision
UpdateArchive
AddFromArchive
MoveMemberFrom
MoveMemberTo
CreateSubproject
AddSubproject
AddSharedSubproject
DropSubproject
ConfigureSubprojectFrom
ConfigureSUbprojectTo
MoveSubprojectFrom
MoveSubprojectTo
If you do not specify any arguments, the count of all unique change package entry operations is returned. For example, the rename operation is only counted as one entry rather than separate entries for RenameFrom and RenameTo operations.
Integer
SICPBytesAdded()
Returns the sum of the bytes added by each change package entry for all change packages associated with the item.
Returns 0 for binary files.
Specified arguments must be text constant suffix matches for the members in the change package. For example, SICPBytesAdded(".java", ".c").
Integer
SICPBytesDeleted()
Returns the sum of the bytes deleted by each change package entry for all change packages associated with the item.
Returns 0 for binary files.
Specified arguments must be text constant suffix matches for the members in the change package. For example, SICPBytesDeleted(".java", ".c").
Integer
SIDaysCPOpen()
Returns the total number of days that changes packages associated with the item are open.
If a change package is currently open, the current time is used to calculate the number of days.
If the function used is based on a date and time in the past, the count is based on the specified time. Any change packages created after the specified time are not counted. The number of days open for change packages that are closed after the specified time is calculated using the specified time as the close time.
Integer
SICPLinesAdded()
Returns the sum lines added by each change package entry for all change packages associated with the item.
Returns 0 for binary files.
Specified arguments must be text constant suffix matches for the members in the change package. For example, SICPLinesAdded(".java", ".c").
Integer
SICPLinesDeleted()
Returns the lines deleted by each change package entry for all change packages associated with the item.
Returns 0 for binary files.
Specified arguments must be text constant suffix matches for the members in the change package. For example, SICPLinesDeleted(".java", ".c").
Integer
SIMetric(siproject-field-name, metric name)
Returns the calculated value of metric for the configuration management project.
Integer
SIMetricCount(siproject-field-name, metric name)
Returns the number of items that make up the metric value for the configuration management project.
Integer
NumberOfEntriesToState(state-name)
Returns the number of times specified for the state entered. To specify the unspecified state, type "Unspecified". For example, NumberOfEntriesToState("Unspecified").
Integer
numberOfHistoryEntries()
Returns the number of deltas associated with the item. This refers to the number of times that the item was edited.
Integer
numberOfModifications(field-name)
Returns number of deltas or changes for the specified field.
Integer
HistoricFieldValue(field-name, timestamp-constant)
Returns the value of the specified field at the specific point in history.
Warning: This operation can take a long time to complete.
Type of specified field name
RelCount(relationship-field)
Returns the number of related items through the specified relationship field. This is functionally equivalent to aggregate(relationship-field, count()).
Integer
RelExists(relationship-field)
Returns whether the relationships exist through the specified relationship field.
Boolean
Aggregate(relationship-field, ByDocument(recurseInclude,recurseReference)[, ...], aggregate-expression)
The Aggregate function operates against a single item, using that single item to find multiple items that are then run against an aggregate expression to calculate a single value.
* 
You must specify at least one relationship field.
In the case of multiple relationship fields, calculations are performed level by level by following the specified relationship fields. For example:
Aggregate(“Field1”,“Field2”,“Field3”,…, sum(IntegerField))
At the first level, the Aggregate function finds all the related items through Field1 and totals the values for a result. This result becomes part of a set of values.
At the second level, the Aggregate function takes the related items found at the first level and finds all their related values through Field2. The total of these values is added to the set of values.
At the third level, the Aggregate function takes the related items found at the second level and finds all their related values through Field3. The total of these values is also added to the set of values.
The loop is repeated for each relationship field level that is specified. A single value, the IntegerField sum value, is then calculated from the resulting set of values found at each level.
* 
If there is a complex or deep nesting of relationships, the Aggregate function does have the potential to adversely affect performance on the Windchill RV&S server.
The ByDocument function operates on items found through the relationship field as documents (that is, items found through the contains relationship), finding all their associated nodes, and recursing into the included and referenced documents.
* 
The ByDocument function must be applied as the first field in the aggregate computation.
Type of aggregate expression
Query(query-name-string[, correlation-field[, ...]], aggregate-expression)
Operates against a single item using that single item to find multiple items it aggregates into for the single value. query-name-string is name of a query as quoted string in syntax "username:queryname". If no correlation-fields are given, the value of the current item is not used, and the result of expression is constant. An aggregation expression runs against all items that satisfy the query. Otherwise, the query is modified to require each specified correlation-field to match the source item. The resulting list of items has aggregate-expression run against it and returned.
Integer or float, depending on aggregation-expression
Query(query-name-string[, source-correlation-field, target-correlation-field[, ...]], aggregate-expression)
This is a more generalized form of the previous Query function. If source-correlation-field is the same as target-correlation-field, you would want to use the previous Query function. This Query function takes list of fields that match between source and target items. It is useful when you want to match between a master item that has a field set equal to values on all related items, in particular, to the Project field.
Integer or floating point, depending on aggregation-expression; see Query function
QueryCorrelated(query-name-string[, source-correlation-field, target-correlation-field[, ...]], aggregate-expression)
To express Query as QueryCorrelated function, specify aggregation-field from Query as both source-correlation-field and target-correlation-field.
Allows you to specify matching fields on both sides. This is useful for item backed pick list (IBPL) fields. For example, if you have an item type that defines a set of something, like applications, the IBPL links each member of application back to the application while a query backed relationship (QBR) field is used for linking between each application to each of its members. You can use the QueryCorrelated function on application using item ID from Application item correlated with IBPL representing Application on Defect that is a member of it. For example:
QueryCorrelated("All Defects", ID, "Application IBPL", count())
Integer or floating point, depending on aggregation-expression; see Query function
Item Information Functions
Name and Description
Return Value
getFieldValue(item#, field)
Returns a field value in a specific item ID. For example, getFieldValue (234, “Found in Build”) returns a Found in Build field value of 7415 for Defect 234.
Depends on field type
IsState(statename[, ...])
Returns true if the item’s state is any of the states specified in the argument list.
To specify the unspecified state, type "Unspecified". For example, IsState("Unspecified").
Boolean
IsType()(typename[, ...])
Returns true if the item’s type is any of the types specified in the argument list.
Boolean
IsNode()
Returns true if the item is any of type node.
Boolean
IsSegment()
Returns true if the item any of type segment.
Boolean
IsSharedItem()
Returns true if the item is any of type shared item.
Boolean
IsContent()
Returns true if the item is any of type content.
Boolean
IsSubsegment()
Returns true if the item is any of type subsegment.
Boolean
IsMeaningful()
Returns true if item any of type node or segment is meaningful.
Boolean
IsNonMeaningful()
Returns true if the item is any of type node or if segment is non-meaningful.
Boolean
IsGroupDocument()
Returns true if the item is any of type segment that has the Group Document flag set.
Boolean
IsTestCase()
Returns true if the item type has a test management role of Test Case.
Boolean
IsTestSession()
Returns true if the item type has a test management role of Test Session.
Boolean
IsTestStep()
Returns true if the item type has a test management role of Test Step.
Boolean
IsTestSuite()
Returns true if the item type has a test management role of Test Suite.
Boolean
IsLive()
Returns true if item type node or segment is live. This function is useful for specifying live items only in a computation.
Boolean
IsVersioned()
Returns true if the item type node or segment is versioned. This function is useful for specifying versioned items only in a computation.
Boolean
Test Functions
Name and Description
Return Value
TestVerdict(test-verdict-name)
A test verdict name constant that can be used in a comparison. For example, LastResult()==TestVerdict(Passed).
Text
TestVerdictByType(verdict-type-name)
A test verdict type constant corresponding to the pass, fail, or other.
Text
TestVerdictName(id)
Returns the display name of the verdict corresponding to the ID. For example, TestVerdictName(TestVerdict(Passed) returns Passed; TestVerdictName(LastResult()) returns the last test result as a string.
Text
TestVerdictTypeName(verdict-type-id)
Returns the name of the test verdict type. For example, TestVerdictTypeName(TestVerdictByType(pass)) returns Pass.
Text
VerdictToType(verdict-id-expression)
Returns the numeric verdict type value for the given verdict ID. You can apply this to LastResult() to check the verdict type of a result. For example, VerdictToType(LastResult())==TestVerdictByType(pass) indicates if a result was a pass verdict type.
Integer
ResultCount(test-verdict-name)
Returns the number of test results with a specific verdict. For example, ResultCount(Passed) returns the number of successful test results. This function is intended to be used with test session type items.
Integer
ResultCountByType(verdict-type-name)
Returns the number of test results with a specific verdict type (pass, fail, or other). For example, if you have two test verdicts with a verdict type of fail, the function ResultCountByType(fail) returns the number of test results with either verdict. This function is intended to be used with test session type items.
Integer
ResultCount(Relationship-field, test-verdict-name)
Returns the number of test results with a specific verdict in related test session type items.
Integer
ResultCountByType(Relationship-field, verdict-type-name)
Returns the number of test results with a specific verdict type (pass, fail, or other) in related test session items.
Integer
LastResult()
Returns the internal ID of the most recent test result for the current item. This function must be used with the TestVerdictName function to convert the internal ID to a display string. For example, TestVerdictName(LastResult()).
Integer
LastResultAnnotation()
Returns the annotation of the most recent test result for the current item. A list of test session IDs can optionally be specified. For example, LastResultAnnotation(sessionID1, sessionID2, sessionID3, ...) returns the annotation of the most recent test result for the list of one or more session IDs.
Text
LastResultSessionID()
Returns the session ID of the most recent test result for the current item. A list of test session IDs can optionally be specified. For example, LastResultSessionID(sessionID1, sessionID2, sessionID3, ...) returns the session ID of the most recent test result for the list of one or more session IDs.
Integer
LastResultDate()
Returns the date that the most recent test result for the current item was modified. A list of test session IDs can optionally be specified. For example, LastResultDate(sessionID1, sessionID2, sessionID3, ...) returns the date of the most recent test result for the list of one or more session IDs.
Date
LastResultFreezeDate()
Returns the freeze date of the most recent test result for the current item. A list of test session IDs can optionally be specified. For example, LastResultFreezeDate(sessionID1, sessionID2, sessionID3, ...) returns the freeze date of the most recent test result for the list of one or more session IDs.
Date
* 
You can combine LastResult test management computations to facilitate use cases. For example, you can annotate the test case with a field that shows the project in which the test case was last tested. To accomplish this, you would use an expression like GetFieldValue(LastResultSessionID(),"Project") on the test case.