<?xml version="1.0" encoding="UTF-8"?>
<!--Arbortext, Inc., 1988-2015, v.4002-->
<!DOCTYPE pubsConcept PUBLIC "-//PTC//DTD PUBS DITA Concept//EN"
 "pubsConcept.dtd">
<?Pub UDT template _font?>
<?Pub UDT _bookmark _target?>
<?Pub Inc?>
<pubsConcept id="_comp_expression_functions_92812" xml:lang="en"
xmlns:import="http://www.oberontech.com/import" import:style="0_Topic"
import:mapobject="1Heading_to_conceptH1"
import:id2="_comp_expression_functions_55979">
<title>Computed Expression Function Classes</title>
<prolog>
<metadata><keywords>
<indexterm>function classes<indexterm>computed expression</indexterm
></indexterm>
<indexterm>computed expression<indexterm>function classes</indexterm
></indexterm>
<indexterm>arithmetic<indexterm> function<indexterm>described</indexterm
></indexterm></indexterm>
<indexterm>function<indexterm>arithmetic<indexterm>described</indexterm
></indexterm></indexterm>
<indexterm>day/time function<indexterm>described</indexterm></indexterm>
<indexterm>function<indexterm>day/time<indexterm>described</indexterm
></indexterm></indexterm>
<indexterm>aggregated function<indexterm>described</indexterm></indexterm>
<indexterm>function<indexterm>aggregate<indexterm>described</indexterm
></indexterm></indexterm>
<indexterm>text function<indexterm>described</indexterm></indexterm>
<indexterm>function<indexterm>text<indexterm>described</indexterm
></indexterm></indexterm>
<indexterm>external information function<indexterm>described</indexterm
></indexterm>
<indexterm>function<indexterm>external information<indexterm>described</indexterm
></indexterm></indexterm>
<indexterm>item information function<indexterm>described</indexterm
></indexterm>
<indexterm>function<indexterm>item information<indexterm>described</indexterm
></indexterm></indexterm>
<indexterm>test function<indexterm>described</indexterm></indexterm>
<indexterm>function<indexterm>test<indexterm>described</indexterm
></indexterm></indexterm>
<indexterm>documents<indexterm>function classes</indexterm></indexterm>
</keywords></metadata>
</prolog>
<pubsConbody>
<p>In a computed expression, you can use the following function classes
to perform calculations:</p>
<ul>
<li import:style="Bullet Bold"><p>Arithmetic Functions</p><p
import:style="Bullet Text">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.</p><p import:style="Bullet Text">For a complete
list of arithmetic functions, see <xref format="dita"
href="#./_comp_expression_functions_60818" scope="local" type="section"
>Arithmetic Functions</xref>.</p></li>
<li import:style="Bullet Bold"><p>Date/Time Functions</p><p
import:style="Bullet Text">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.</p><p import:style="Bullet Text">For a complete list
of date/time functions, see <xref format="dita"
href="#./_comp_expression_functions_39193" scope="local" type="section"
>Date/Time Functions</xref>.</p></li>
<li import:style="Bullet Bold"><p>Aggregate Functions</p><p
import:style="Bullet Text">An aggregate function is used to perform
aggregate calculations of item data. For example, using the <codeph
import:style="Literal">sum</codeph> 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.</p><p import:style="Bullet Text"
>For a complete list of aggregate functions, see <xref format="dita"
href="#./_comp_expression_functions_91884" scope="local" type="section"
>Aggregate Functions</xref>.</p></li>
<li import:style="Bullet Bold"><p>Text Functions</p><p
import:style="Bullet Text">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 <codeph import:style="Literal"
>REQ-00001234</codeph>. String expressions in text functions accept
short and long text fields.</p><p import:style="Bullet Text">For a
complete list of text functions, see <xref format="dita"
href="#./_comp_expression_functions_48345" scope="local" type="section"
>Text Functions</xref>.</p></li>
<li import:style="Bullet Bold"><p>External Information Functions</p
><p import:style="Bullet Text">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 <codeph
import:style="Literal">Submit</codeph> state. Attempting to use an
external information function in an aggregate expression results in
an error. For example, <codeph import:style="Literal">SICPEntryCount()</codeph
> is an invalid aggregate expression, but <codeph import:style="Literal"
>sum(SICPEntryCount())</codeph> is valid because the argument to an
aggregate function is a normal expression. <codeph
import:style="Literal">SICPEntryCount()</codeph> is part of the normal
expression and is therefore valid. </p><p import:style="Bullet Text"
>For example, it is valid to use <codeph import:style="Literal">DaysInState()</codeph
> 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, <codeph
import:style="Literal">avg(DaysInState())</codeph>.</p><p
import:style="Bullet Text">For a complete list of external information
functions, see <xref format="dita"
href="#./_comp_expression_functions_10509" scope="local" type="section"
>External Information Functions</xref>.</p></li>
<li import:style="Bullet Bold"><p>Item Information Functions</p><p
import:style="Bullet Text">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.</p><p import:style="Bullet Text">For a complete list
of item information functions, see <xref format="dita"
href="#./_comp_expression_functions_63405" scope="local" type="section"
>Item Information Functions</xref>.</p></li>
<li import:style="Bullet Bold"><p>Test Functions</p><p
import:style="Bullet Text">A test function is used to return information
about test results. For example, return the numeric verdict type value
for a given verdict ID.</p><p import:style="Bullet Text">For a complete
list of test functions, see <xref format="dita"
href="#./_comp_expression_functions_22430" scope="local" type="section"
>Test Functions</xref>.</p></li>
</ul>
<section id="_comp_expression_functions_305522"
import:style="4HeadingNoTopic"><title>Key Considerations</title><ul>
<li><p>All fields return values specific to their field type. However,
picklist fields return their numeric (non-textual) values. For example, <codeph
import:style="Literal">getFieldValue (567, Priority)</codeph> displays <codeph
import:style="Literal">1</codeph> as the field value for <codeph
import:style="GUI">Priority</codeph>=<codeph import:style="Literal"
>High</codeph> for <codeph import:style="Literal">Defect 567</codeph
>.</p></li>
<li><p>Node, segment, shared item, and test types are used by the
document model.</p></li>
<li><p>If document versioning is enabled, computed expressions return
all items (live and versioned) by default. To specify live or versioned
items, include the <codeph>IsLive()</codeph> or <codeph>IsVersioned()</codeph
> function.</p></li>
<li><p>Text strings in text calculations cannot exceed 1 kilobyte.
Exceeding this limit can cause the <ph
conref="../common/text_variables.dita#text_variables/ProdName01"></ph
> server to fail.</p></li>
</ul></section>
<section id="_comp_expression_functions_60818"
import:style="0_TopicSub2"><title>Arithmetic Functions</title><table
import:table-style="Format A">
<tgroup cols="2">
<?PubTbl tgroup dispwid="1237.00px"?>
<colspec colname="1" colwidth="396.86*"/><colspec colname="2"
colwidth="88.25*"/>
<thead>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="middle"
><p>Name and Description</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="middle"
><p>Return Value</p></entry>
</row>
</thead>
<tbody>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">abs(numeric-expression)</codeph
></p><p>Returns absolute value of numeric expression.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer or floating point</p><p>(same as expression)</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">sign(numeric-expression)</codeph
></p><p>Returns <codeph import:style="Literal8">-1</codeph> if expression
evaluates to &lt; 0, <codeph import:style="Literal8">0</codeph> if
it evaluates to 0, and <codeph import:style="Literal8">+1</codeph
> if it evaluates to a positive number.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer or floating point</p><p>(same as expression)</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">round(numeric-expression)</codeph
></p><p>Returns expression rounded to nearest integer.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">truncate(numeric-expression)</codeph
></p><p>Returns expression truncated to nearest integer.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">floor(numeric-expression)</codeph
></p><p>Returns largest integer less than or equal to given numeric
expression. </p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">ceil(numeric-expression)</codeph
></p><p>Returns smallest integer greater than or equal to given numeric
expression. </p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">mod(numeric-expression1, numeric-expression2)</codeph
></p><p>Returns remainder of first expression divided by second expression.</p
><p>If either expression is not an integer, then the expression is:</p
><p><codeph import:style="Literal8">(abs(e1) - floor(abs(e1)/abs(e2))
* abs(e2)) * sign(e1)</codeph></p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer if both expressions integers; otherwise, floating point</p
></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">isEmpty(expression1, expression2)</codeph
></p><p>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.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Type in expression</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">emptyint()</codeph></p><p>Returns
an empty value in an integer field.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>none</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">emptyfloat()</codeph></p><p>Returns
an empty value in a floating point field.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>none</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">emptytime()</codeph></p><p>Returns
an empty value in a date/time field.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>none</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">emptydate()</codeph></p><p>Returns
an empty value in a date field.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>none</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">emptylogical()</codeph></p><p
>Returns an empty value in a logical field.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>none</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">emptytext()</codeph></p><p>Returns
an empty value in a text field.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>none</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">emptyuser()</codeph></p><p>Returns
an empty value in a user field.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>none</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">emptygroup()</codeph></p><p>Returns
an empty value in a group field.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>none</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">timestamp(quoted-string)</codeph
></p><p>Converts the supplied string into timestamp constant. Using
Java <codeph import:style="Literal8">SimpleDateFormat</codeph>, the
following formats are attempted in order until one succeeds:</p><ul>
<li><p><codeph import:style="Literal8">Java DateTimeInstance(LONG,
LONG)</codeph></p></li>
<li><p><codeph import:style="Literal8">Java DateTimeInstance(SHORT,
SHORT)</codeph></p></li>
<li><p><codeph import:style="Literal8">MMM d, yyyy hh:mm a</codeph
></p></li>
<li><p><codeph import:style="Literal8">MMM d, yyyy HH:mm</codeph></p
></li>
<li><p><codeph import:style="Literal8">MMM d, yyyy HH:mm:ss</codeph
></p><note><p>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.</p></note></li>
</ul></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Timestamp</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">now()</codeph></p><p>Returns current
time. </p><note><p>Current time is time when the expression evaluated
is not parsed. To return the number of days an item has existed, type:</p
><p><codeph import:style="Literal8">now() - "Created Date"</codeph
></p></note></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Timestamp</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">SelectionCount(field-name)</codeph
></p><p>Returns the number of entries selected in a multi-valued field
on an item. If the field is empty, returns <codeph
import:style="Literal8">0</codeph><codeph import:style="Literal">;</codeph
> if the field is not empty but is not multi-valued, returns <codeph
import:style="Literal8">1</codeph>.</p><p>Not valid for attachment,
relationship, or computed fields.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
</tbody>
</tgroup>
</table></section>
<section id="_comp_expression_functions_39193"
import:style="0_TopicSub2"><title>Date/Time Functions</title><table
import:table-style="Format A">
<tgroup cols="2">
<?PubTbl tgroup dispwid="1238.00px"?>
<colspec colname="1" colwidth="396.15*"/><colspec colname="2"
colwidth="88.91*"/>
<thead>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="middle"
><p>Name and Description</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="middle"
><p>Return Value</p></entry>
</row>
</thead>
<tbody>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">DateDiff(date/time field1, date/time
field2)</codeph></p><p>Returns number of seconds between two date/time
fields. If <codeph import:style="Literal8">date/time field1</codeph
> is larger than <codeph import:style="Literal8">date/time field2</codeph
>, the result is positive. Otherwise, the result is negative. </p
><p>By including the <codeph import:style="Literal8">dateFirstEntered</codeph
> function, you can calculate the number of seconds to close an Incident
item. For example, <codeph import:style="Literal8">DateDiff(dateFirstEntered(“Closed”),
“Created Date”)</codeph>.</p><note><p>To correctly calculate the expression,
the <codeph import:style="GUI8">Include Time</codeph> option must
be enabled in each specified date/time field.</p></note></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">DaysInState(state-name)</codeph
></p><p>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.</p><p>To specify the unspecified
state, type <codeph import:style="Literal8">"Unspecified"</codeph
>. For example, <codeph import:style="Literal8">DaysInState("Unspecified")</codeph
>.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">DaysInPhase(phase field name,
phase name)</codeph></p><p>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.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">DaysCurrentState()</codeph></p
><p>Returns the number of days the item is in current state rounded
to the nearest day. </p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">DayOfYear(date/timestamp/field)</codeph
></p><p>Returns the day of the year for the specified date.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">dayOfWeek(date/timestamp/field)</codeph
></p><p>Returns the day of the week for the specified date. Sunday
is <codeph import:style="Literal8">1</codeph>, Monday is <codeph
import:style="Literal8">2</codeph>, and so on.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">weekOfYear(date/timestamp/field)</codeph
></p><p>Returns the week of the year for the specified date.</p><note
><p><ph conref="../common/text_variables.dita#text_variables/ProdName01"
></ph> 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 <ph
conref="../common/text_variables.dita#text_variables/ProdName01"></ph
>, calendar week 1 begins on January 1, 2010. In ISO-8601, calendar
week 1 begins on January 4, 2010.</p><?Pub Caret 164?></note></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">monthOfYear(date/timestamp/field)</codeph
></p><p>Returns the month of the year for the specified date.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">weeksDiff(dateA, dateB)</codeph
></p><p>Returns the number of weeks between two specified dates.</p
><note><p>This is the number of actual weeks, not the number of days
divided by 7.</p></note></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">monthsDiff(dateA, dateB)</codeph
></p><p>Returns the number of months between two specified dates.</p
><note><p>This is the number of actual months, not the number of days
divided by 30.</p></note></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">weekdaysDiff(dateA, dateB)</codeph
></p><p>Returns the number of weekdays between two specified dates.
Saturdays and Sundays are not included.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">DayOfWeekName(date/timestamp)</codeph
></p><p>Returns the day of week for the specified date or date and
time. For example, Monday.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Text</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">getDay(date/timestamp/field)</codeph
></p><p>Returns the date for the specified date or date and time.
For example, 23.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">getYear(date/timestamp/field)</codeph
></p><p>Returns the date for the specified date or date and time.
For example, 2009.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">MonthOfYearName(date/timestamp/field)</codeph
></p><p>Returns the month of the year for the specified date or date
and time. For example, October.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Text</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">getHour(timestamp/field)</codeph
></p><p>Returns the hour for the specified time. For example, 2.</p
><note><p>Hours are specified in 24-hour time. For example, midnight
is 0 and 7pm is 19.</p></note></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">getMinute(timestamp/field)</codeph
></p><p>Returns the minute for the specified time. For example, 05.</p
></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">getSecond(timestamp/field)</codeph
></p><p>Returns the second for the specified time. For example, 33.</p
></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">DaysCurrentPhase(phase-field-name)</codeph
></p><p>Returns the number of days that the item is in the current
phase rounded to the nearest day. </p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">dateFirstEntered(state-name)</codeph
></p><p>Returns the date that the specified state was first entered. </p
></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Timestamp</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">dateLastEntered(state-name)</codeph
></p><p>Returns the date that the specified state was last entered.</p
></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Timestamp</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">SecondsInState</codeph></p><p
>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.</p><p>To specify the unspecified state, type <codeph
import:style="Literal8">"Unspecified"</codeph>. For example, <codeph
import:style="Literal8">SecondsInState("Unspecified")</codeph>.</p
></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">SecondsInPhase</codeph></p><p
>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.</p><p>To specify unspecified phase, type <codeph
import:style="Literal8">"Unspecified"</codeph>, for example, <codeph
import:style="Literal8">SecondsInPhase("Unspecified")</codeph>.</p
></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">SecondsCurrentState</codeph></p
><p>Returns the number of seconds that the item is in the current
state.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">SecondsCurrentPhase</codeph></p
><p>Returns the number of seconds that the item is in the current
phase.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">sumTimeEntry[(date("startdate"),date("enddate"))]</codeph
></p><p>or</p><p><codeph import:style="Literal8">sumTimeEntry[(symbolicdate(),symbolicdate())]</codeph
></p><p>Returns the total time (rounded to the hour) spent on the
item in the optional timeframe.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">sumTimeEntryByUser(user[,user...]</codeph
><?Pub _newline?><codeph import:style="Literal8">[,date("startdate"),date("enddate")]</codeph
></p><p>or</p><p><codeph import:style="Literal8">sumTimeEntryByUser(user[,user...]</codeph
><?Pub _newline?><codeph import:style="Literal8">[,symbolicdate(),symbolicdate()]</codeph
></p><p>Returns the total time (rounded to the hour) spent on the
item by specified users in the optional timeframe.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">sumTimeEntryByGroup(group[,group...]</codeph
><?Pub _newline?><codeph import:style="Literal8">[,date("startdate"),date("enddate")])</codeph
></p><p>or</p><p><codeph import:style="Literal8">sumTimeEntryByGroup(group[,group...]</codeph
><?Pub _newline?><codeph import:style="Literal8">[,symbolicdate(),symbolicdate()])</codeph
></p><p>Returns the total time (rounded to the hour) spent on the
item by specified groups in the optional timeframe.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">sumTimeEntryByPhase(phaseField,
phase[,date("startdate"),date("enddate")])</codeph></p><p>or</p><p
><codeph import:style="Literal8">sumTimeEntryByPhase(phaseField, phase[,symbolicdate(),symbolicdate()])</codeph
></p><p>Returns the total time (rounded to the hour) spent on the
item while in the phase for the specified phase field.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">sumTimeEntryByPhaseByUser(phaseField,
phase, user[,user...][,date("startdate"),</codeph><?Pub _newline?><codeph
import:style="Literal8">date("enddate")])</codeph></p><p>or</p><p
><codeph import:style="Literal8">sumTimeEntryByPhaseByUser(phaseField,
phase, user[,user...][,symbolicdate(),symbolicdate()])</codeph></p
><p>Returns the total time (rounded to the hour) spent on the item
by specified users while in the phase for the specified phase field.</p
></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">sumTimeEntryByPhaseByGroup(phaseField,
phase, group[,group...][,date("startdate"),</codeph><?Pub _newline
?><codeph import:style="Literal8">date("enddate")])</codeph></p><p
>or</p><p><codeph import:style="Literal8">sumTimeEntryByPhaseByGroup(phaseField,
phase, group[,group...][,symbolicdate(),</codeph><?Pub _newline?><codeph
import:style="Literal8">symbolicdate()])</codeph></p><p>Returns the
total time spent (rounded to the hour) on the item by specified groups
while in the phase for the specified phase field.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">sumTimeEntryByState(state[,date("startdate"),
date("enddate")])</codeph></p><p>or</p><p><codeph
import:style="Literal8">sumTimeEntryByState(state[,symbolicdate(),
symbolicdate()])</codeph></p><p>Returns the total time spent (rounded
to the hour) on the item while in the specified state.</p><note><p
><ph conkeyref="text_variables/ProdName01"></ph> gathers time entries
on a daily basis and assigns the time entry to the date (to midnight). <ph
conkeyref="text_variables/ProdName01"></ph> 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.</p><p>For example, an
item is posted, moves through several states (<codeph
import:style="Literal8">Investigate</codeph>, <codeph
import:style="Literal8">In Development</codeph> , <codeph
import:style="Literal8">Development Done</codeph>), and is closed
(<codeph import:style="Literal8">Built</codeph>) in a single day.&nbsp;Then,
the user working on the item enters the total time spent on the item
in a time entry.&nbsp;Because <ph conkeyref="text_variables/ProdName02a"
></ph> cannot subdivide this time entry (hours spent on the item)
into multiple pieces of information (hours spent in each state),&nbsp;the <codeph
import:style="Literal8">sumTimeEntryByState</codeph> function assigns
the time entry to a single state: the state that the item had on midnight
on the day of the entry (<codeph import:style="Literal8">Built</codeph
>).</p></note><p>To specify the unspecified state, type <codeph
import:style="Literal8">"Unspecified"</codeph>. For example, <codeph
import:style="Literal8">sumTimeEntryByState("Unspecified")</codeph
>.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">sumTimeEntryByStateByUser(state,
user[,date("startdate"),date("enddate")])</codeph></p><p>or</p><p
><codeph import:style="Literal8">sumTimeEntryByStateByUser(state (user[,symbolicdate(),symbolicdate()])</codeph
></p><p>Returns the total time spent (rounded to the hour) on the
item by specified users while in the specified state.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">sumTimeEntryByStateByGroup(state,
group[,date("startdate"),date("enddate")])</codeph></p><p>or</p><p
><codeph import:style="Literal8">sumTimeEntryByStateByGroup(state,
group[,symbolicdate(),symbolicdate()])</codeph></p><p>Returns the
total time spent (rounded to the hour) on the item by specified groups
while in the specified state.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">countTimeEntry(date("startdate"),
date("enddate"))</codeph></p><p>or</p><p><codeph import:style="Literal8"
>countTimeEntry(symbolicdate(),symbolicdate())</codeph></p><p>Returns
the number of time entries for the item with a duration greater than
zero in the optional timeframe.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">countTimeEntryByUser(user[,user...]
[,date("startdate"),date("enddate")])</codeph></p><p>or</p><p><codeph
import:style="Literal8">countTimeEntryByUser(user[,user...] [,symbolicdate(),symbolicdate()])</codeph
></p><p>Returns the number of time entries for the item by specified
users with a duration greater than zero in the optional timeframe.</p
></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">countTimeEntryByGroup(group[,group...]
[,date("startdate"),date("enddate")])</codeph></p><p>or</p><p><codeph
import:style="Literal8">countTimeEntryByGroup(group[,group...] [,symbolicdate(),symbolicdate()])</codeph
></p><p>Returns the number of time entries for the item by specified
groups with a duration greater than zero in the optional timeframe.</p
></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">firstTimeEntryDate()</codeph></p
><p>Returns the earliest date time is recorded against the item.</p
></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Date</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">lastTimeEntryDate()</codeph> </p
><p>Returns the latest date time is recorded against the item.</p
></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Date</p></entry>
</row>
</tbody>
</tgroup>
</table></section>
<section id="_comp_expression_functions_91884"
import:style="0_TopicSub2"><title>Aggregate Functions</title><table
import:table-style="Format A">
<tgroup cols="2">
<?PubTbl tgroup dispwid="1238.00px"?>
<colspec colname="1" colwidth="395.76*"/><colspec colname="2"
colwidth="89.31*"/>
<thead>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="middle"
><p>Name and Description</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="middle"
><p>Return Value</p></entry>
</row>
</thead>
<tbody>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">sum(numeric-expression)</codeph
></p><p>Adds expressions calculated against each item that the aggregation
runs against. </p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer or floating point, same as expression</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">avg(numeric-expression)</codeph
></p><p>Adds expressions calculated against each item that the aggregation
runs against and then divides by number of non-empty entries. </p
></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Floating point</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">min(numeric-expression or timestamp)</codeph
></p><p>Finds the smallest of expressions from each item that the
aggregation runs against. If all expressions are empty, the result
is empty. </p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer, float point, or timestamp same as expression</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">max(numeric-expression or timestamp)</codeph
></p><p>Finds the largest of the expressions from each item that the
aggregation runs against. If all expressions are empty, the result
is empty. </p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer, floating point, or timestamp same as expression</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">count()</codeph></p><p>Returns
the number of items that the aggregation is run against. </p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">sumTimeEntrySecs[(date("startdate"),date("enddate"))]</codeph
></p><p>or</p><p><codeph import:style="Literal8">sumTimeEntrySecs[(symbolicdate(),symbolicdate())]</codeph
></p><p>Returns the total time spent (in seconds) on an item in an
optional timeframe.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">sumTimeEntrySecsByUser(user[,user...][,date("startdate"),date("enddate")]</codeph
></p><p>or</p><p><codeph import:style="Literal8">sumTimeEntrySecsByUser(user[,user...][,symbolicdate(),symbolicdate()]</codeph
></p><p>Returns the total time spent (in seconds) on an item by specified
users in an optional timeframe.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">sumTimeEntrySecsByGroup(group[,group...][,date("startdate"),date("enddate")])</codeph
></p><p>or</p><p><codeph import:style="Literal8">sumTimeEntrySecsByGroup(group[,group...][,symbolicdate(),symbolicdate()])</codeph
></p><p>Returns the total time spent (in seconds) on an item by specified
groups in an optional timeframe.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">sumTimeEntrySecsByState(state[,date("startdate"),date("enddate")])</codeph
></p><p>or</p><p><codeph import:style="Literal8">sumTimeEntrySecsByState(state[,symbolicdate(),symbolicdate()])</codeph
></p><p>Returns the total time spent (in seconds) on an item while
in the specified state.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">sumTimeEntrySecsByStateByUser(state,
user[,date("startdate"),date("enddate")])</codeph></p><p>or</p><p
><codeph import:style="Literal8">sumTimeEntrySecsByStateByUser(state
(user[,symbolicdate(),symbolicdate()])</codeph></p><p>Returns the
total time spent (in seconds) on an item by specified users while
in the specified state.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">sumTimeEntrySecsByStateByGroup(state,
group[,date("startdate"),date("enddate")])</codeph></p><p>or</p><p
><codeph import:style="Literal8">sumTimeEntrySecsByStateByGroup(state,
group[,symbolicdate(),symbolicdate()])</codeph></p><p>Returns the
total time spent (in seconds) on an item by specified groups while
in the specified state.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">sumTimeEntrySecsByPhase(phaseField,
phase[,date("startdate"),date("enddate")])</codeph></p><p>or</p><p
><codeph import:style="Literal8">sumTimeEntrySecsByPhase</codeph><?Pub
_newline?><codeph import:style="Literal8">(phaseField, phase[,symbolicdate(),symbolicdate()])</codeph
></p><p>Returns the total time spent (in seconds) on an item while
in the phase for the specified phase.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">sumTimeEntrySecsByPhaseByUser(phaseField,
phase, user[,user...][,date("startdate"),date("enddate")])</codeph
></p><p>or</p><p><codeph import:style="Literal8">sumTimeEntrySecsByPhaseByUser(phaseField,
phase, user[,user...][,symbolicdate(),symbolicdate()])</codeph></p
><p>Returns the total time spent (in seconds) on an item by specified
users while in the phase for the specified phase.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">sumTimeEntrySecsByPhaseByGroup(phaseField,
phase, group[,group...][,date("startdate"), date("enddate")])</codeph
></p><p>or</p><p><codeph import:style="Literal8">sumTimeEntrySecsByPhaseByGroup(phaseField,
phase, group[,group...][,symbolicdate(),symbolicdate()])</codeph></p
><p>Returns the total time spent (in seconds) on an item by specified
groups while in the phase for the specified phase.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">LastResultAgg()</codeph></p><p
>Returns the internal ID of the most recent test result record for
a group of items. This function must be used with the <codeph
import:style="Literal8">Aggregate</codeph>, <codeph
import:style="Literal8">AggregateByTree</codeph>, or <codeph
import:style="Literal8">Query</codeph> function. For example, <codeph
import:style="Literal8">AggregateByTree (LastResultAgg())</codeph
>. This function must be used with the <codeph import:style="Literal8"
>TestVerdictName</codeph> function to convert the internal ID to a
display string. For example, <codeph import:style="Literal8">TestVerdictName(LastResultAgg()).</codeph
></p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
</tbody>
</tgroup>
</table></section>
<section id="_comp_expression_functions_48345"
import:style="0_TopicSub2"><title>Text Functions</title><table
import:table-style="Format A">
<tgroup cols="2">
<?PubTbl tgroup dispwid="1238.00px"?>
<colspec colname="1" colwidth="395.37*"/><colspec colname="2"
colwidth="89.69*"/>
<thead>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="middle"
><p>Name and Description</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="middle"
><p>Return Value</p></entry>
</row>
</thead>
<tbody>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">Text(string)</codeph></p><p>Creates
text constant.</p><note><p>If the string does not contain special
characters, quotes are not required. For example, <codeph
import:style="Literal8">text("REQ")</codeph> and <codeph
import:style="Literal8">text(REQ)</codeph> are identified as the same
string.</p></note></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Text</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">Length(string-expression)</codeph
></p><p>Returns the length of the string. </p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">Upper(string-expression)</codeph
></p><p>Converts the string into uppercase. </p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Text</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">Lower(string-expression)</codeph
></p><p>Converts the string into lowercase. </p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Text</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">Concat(string-expression, string-expression[,
...])</codeph></p><p>Concatenates two or more strings. </p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Text</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">Substring(string-expression, start,
count)</codeph></p><p>Takes the substring of the string. The substring
starts at first character and goes for the count characters. <codeph
import:style="Literal8">start</codeph> offset is <codeph
import:style="Literal8">origin 1</codeph>. <codeph
import:style="Literal8">start</codeph> and <codeph
import:style="Literal8">count</codeph> must be positive integer constants.</p
><p>The following conditions return empty strings:</p><ul>
<li><p><codeph import:style="Literal8">start</codeph> less than or
equal zero.</p></li>
<li><p><codeph import:style="Literal8">start</codeph> greater than
length of string being processed.</p></li>
<li><p><codeph import:style="Literal8">count</codeph> less than zero.</p
></li>
<li><p>If <codeph import:style="Literal8">start</codeph> plus <codeph
import:style="Literal8">length</codeph> 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.</p></li>
</ul></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Text</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">Locate(string-expression, string-expression)</codeph
></p><p>Searches for the first string in a second string.</p><p>To
add <codeph import:style="Literal8">startsWith</codeph>, type <codeph
import:style="Literal8">Locate(x, y) == 1</codeph>. </p><p>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.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">Trim(string-expression)</codeph
></p><p>Removes leading and trailing spaces from the string. </p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Text</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">LTrim(string-expression)</codeph
></p><p>Removes leading spaces from the string.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Text</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">RTrim(string-expression)</codeph
></p><p>Removes trailing spaces from the string.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Text</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">ToText(number-expression)</codeph
></p><p>Converts a number to a string. </p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Text</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">ToTextZeroPad(number-expression,
size)</codeph></p><p>Converts a number to a string with zero padding. </p
><p><codeph import:style="Literal8">size</codeph> must be positive
integer constant.</p><p>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. </p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Text</p></entry>
</row>
</tbody>
</tgroup>
</table></section>
<section id="_comp_expression_functions_10509"
import:style="0_TopicSub2"><title>External Information Functions</title
><table import:table-style="Format A">
<tgroup cols="2">
<?PubTbl tgroup dispwid="1238.00px"?>
<colspec colname="1" colwidth="394.97*"/><colspec colname="2"
colwidth="90.08*"/>
<thead>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="middle"
><p>Name and Description</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="middle"
><p>Return Value</p></entry>
</row>
</thead>
<tbody>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">SICPCount([cpstate, ...])</codeph
></p><p>Returns the number of change packages associated with an item.
Specify one or more of following change package states to include
in the count:</p><ul>
<li><p><uicontrol>Closed</uicontrol></p></li>
<li><p><uicontrol>Open</uicontrol></p></li>
<li><p><uicontrol>Submitted</uicontrol></p></li>
<li><p><uicontrol>Accepted</uicontrol></p></li>
<li><p><uicontrol>Rejected</uicontrol></p></li>
<li><p><uicontrol>Discarded</uicontrol></p></li>
<li><p><uicontrol>CommitFailed</uicontrol></p><p>If you do not specify
any arguments, the count of all change packages is returned.</p></li>
</ul></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">SICPEntryCount([cpentrytype, ...])</codeph
></p><p>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:</p><ul>
<li><p><codeph import:style="Literal8">Update</codeph></p></li>
<li><p><codeph import:style="Literal8">Add</codeph></p></li>
<li><p><codeph import:style="Literal8">Drop</codeph></p></li>
<li><p><codeph import:style="Literal8">Lock</codeph></p></li>
<li><p><codeph import:style="Literal8">RenameFrom</codeph></p></li>
<li><p><codeph import:style="Literal8">RenameTo</codeph></p></li>
<li><p><codeph import:style="Literal8">UpdateRevision</codeph></p
></li>
<li><p><codeph import:style="Literal8">UpdateArchive</codeph></p></li>
<li><p><codeph import:style="Literal8">AddFromArchive</codeph></p
></li>
<li><p><codeph import:style="Literal8">MoveMemberFrom</codeph></p
></li>
<li><p><codeph import:style="Literal8">MoveMemberTo</codeph></p></li>
<li><p><codeph import:style="Literal8">CreateSubproject</codeph></p
></li>
<li><p><codeph import:style="Literal8">AddSubproject</codeph></p></li>
<li><p><codeph import:style="Literal8">AddSharedSubproject</codeph
></p></li>
<li><p><codeph import:style="Literal8">DropSubproject</codeph></p
></li>
<li><p><codeph import:style="Literal8">ConfigureSubprojectFrom</codeph
></p></li>
<li><p><codeph import:style="Literal8">ConfigureSUbprojectTo</codeph
></p></li>
<li><p><codeph import:style="Literal8">MoveSubprojectFrom</codeph
></p></li>
<li><p><codeph import:style="Literal8">MoveSubprojectTo</codeph></p
><p>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 <codeph
import:style="Literal8">RenameFrom</codeph> and <codeph
import:style="Literal8">RenameTo</codeph> operations. </p></li>
</ul></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">SICPBytesAdded()</codeph></p><p
>Returns the sum of the bytes added by each change package entry for
all change packages associated with the item.</p><p>Returns <codeph
import:style="Literal8">0</codeph> for binary files.</p><p>Specified
arguments must be text constant suffix matches for the members in
the change package. For example,  <codeph import:style="Literal8"
>SICPBytesAdded(".java", ".c")</codeph>.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">SICPBytesDeleted()</codeph></p
><p>Returns the sum of the bytes deleted by each change package entry
for all change packages associated with the item.</p><p>Returns <codeph
import:style="Literal8">0</codeph> for binary files.</p><p>Specified
arguments must be  text constant suffix matches for the members in
the change package. For example,  <codeph import:style="Literal8"
>SICPBytesDeleted(".java", ".c")</codeph>.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">SIDaysCPOpen()</codeph></p><p
>Returns the total number of days that changes packages associated
with the item are open.</p><p>If a change package is currently open,
the current time is used to calculate the number of days.</p><p>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.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">SICPLinesAdded()</codeph></p><p
>Returns the sum lines added by each change package entry for all
change packages associated with the item.</p><p>Returns <codeph
import:style="Literal8">0</codeph> for binary files.</p><p>Specified
arguments must be text constant suffix matches for the members in
the change package. For example,  <codeph import:style="Literal8"
>SICPLinesAdded(".java", ".c")</codeph>.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">SICPLinesDeleted()</codeph></p
><p>Returns the lines deleted by each change package entry for all
change packages associated with the item.</p><p>Returns <codeph
import:style="Literal8">0</codeph> for binary files.</p><p>Specified
arguments must be text constant suffix matches for the members in
the change package. For example,  <codeph import:style="Literal8"
>SICPLinesDeleted(".java", ".c")</codeph>.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">SIMetric(siproject-field-name,
metric name)</codeph></p><p>Returns the calculated value of metric
for the configuration management project.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">SIMetricCount(siproject-field-name,
metric name)</codeph></p><p>Returns the number of items that make
up the metric value for the configuration management project.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">NumberOfEntriesToState(state-name)</codeph
></p><p>Returns the number of times specified for the state entered.
To specify the unspecified state, type <codeph import:style="Literal8"
>"Unspecified"</codeph>. For example, <codeph import:style="Literal8"
>NumberOfEntriesToState("Unspecified")</codeph>.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">numberOfHistoryEntries()</codeph
></p><p>Returns the number of deltas associated with the item. This
refers to the number of times that the item was edited.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">numberOfModifications(field-name)</codeph
></p><p>Returns number of deltas or changes for the specified field. </p
></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">HistoricFieldValue(field-name,
timestamp-constant)</codeph></p><p>Returns the value of the specified
field at the specific point in history.</p><p><b>Warning:</b> This
operation can take a long time to complete. </p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Type of specified field name </p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">RelCount(relationship-field)</codeph
></p><p>Returns the number of related items through the specified
relationship field. This is functionally equivalent to <codeph
import:style="Literal8">aggregate(relationship-field, count())</codeph
>. </p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">RelExists(relationship-field)</codeph
></p><p>Returns whether the relationships exist through the specified
relationship field.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Boolean</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">Aggregate(relationship-field,
ByDocument(recurseInclude,recurseReference)[, ...], aggregate-expression)</codeph
></p><p>The <codeph>Aggregate</codeph> 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.</p
><note><p>You must specify at least one relationship field.</p></note
><p>In the case of multiple relationship fields, calculations are
performed level by level by following the specified relationship fields.
For example:</p><p><codeblock>Aggregate(“Field1”,“Field2”,“Field3”,…, sum(IntegerField))</codeblock
></p><p>At the first level, the <codeph>Aggregate</codeph> function
finds all the related items through <codeph>Field1</codeph> and totals
the values for a result. This result becomes part of a set of values.</p
><p>At the second level, the <codeph>Aggregate</codeph> function takes
the related items found at the first level and finds all their related
values through <codeph>Field2</codeph>. The total of these values
is added to the set of values.</p><p>At the third level, the <codeph
>Aggregate</codeph> function takes the related items found at the
second level and finds all their related values through <codeph>Field3</codeph
>. The total of these values is also added to the set of values.</p
><p>The loop is repeated for each relationship field level that is
specified. A single value, the <codeph>IntegerField</codeph> sum value,
is then calculated from the resulting set of values found at each
level.</p><note type="caution"><p>If there is a complex or deep nesting
of relationships, the <codeph>Aggregate</codeph> function does have
the potential to adversely affect performance on the <ph
conref="../common/text_variables.dita#text_variables/ProdName01"></ph
> server.</p></note><p>The <codeph import:style="Literal8">ByDocument</codeph
> function operates on items found through the relationship field
as documents (that is, items found through the <codeph>contains</codeph
> relationship), finding all their associated nodes, and recursing
into the included and referenced documents.</p><note><p>The <codeph
>ByDocument</codeph> function must be applied as the first field in
the aggregate computation.</p></note></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Type of aggregate expression</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">Query(query-name-string[, correlation-field[,
...]], aggregate-expression)</codeph></p><p>Operates against a single
item using that single item to find multiple items it aggregates into
for the single value. <codeph import:style="Literal8">query-name-string</codeph
> is name of a query as quoted string in syntax <codeph
import:style="Literal8">"username:queryname"</codeph>. If no <codeph
import:style="Literal8">correlation-fields</codeph> 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 <codeph import:style="Literal8">correlation-field</codeph
> to match the source item. The resulting list of items has <codeph
import:style="Literal8">aggregate-expression</codeph> run against
it and returned. </p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer or float, depending on aggregation-expression</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">Query(query-name-string[, source-correlation-field,
target-correlation-field[, ...]], aggregate-expression)</codeph></p
><p>This is a more generalized form of the previous <codeph
import:style="Literal8">Query</codeph> function. If <codeph
import:style="Literal8">source-correlation-field</codeph> is the same
as <codeph import:style="Literal8">target-correlation-field</codeph
>, you would want to use the previous <codeph import:style="Literal8"
>Query</codeph> function. This <codeph import:style="Literal8">Query</codeph
> 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 <uicontrol import:style="GUI8">Project</uicontrol> field.</p
></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer or floating point, depending on aggregation-expression;
see Query function</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">QueryCorrelated(query-name-string[,
source-correlation-field, target-correlation-field[, ...]], aggregate-expression)</codeph
></p><p>To express <codeph import:style="Literal8">Query</codeph> as <codeph
import:style="Literal8">QueryCorrelated</codeph> function, specify <codeph
import:style="Literal8">aggregation-field</codeph> from <codeph
import:style="Literal8">Query</codeph> as both <codeph
import:style="Literal8">source-correlation-field</codeph> and <codeph
import:style="Literal8">target-correlation-field</codeph>.</p><p>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 <codeph import:style="Literal8"
>QueryCorrelated</codeph> function on application using item ID from
Application item correlated with IBPL representing Application on
Defect that is a member of it. For example:</p><p><codeph
import:style="Literal8">QueryCorrelated("All Defects", ID, "Application
IBPL", count())</codeph></p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer or floating point, depending on aggregation-expression;
see Query function</p></entry>
</row>
</tbody>
</tgroup>
</table></section>
<section id="_comp_expression_functions_63405"
import:style="0_TopicSub2"><title>Item Information Functions</title
><table import:table-style="Format A">
<tgroup cols="2">
<?PubTbl tgroup dispwid="1238.00px"?>
<colspec colname="1" colwidth="394.58*"/><colspec colname="2"
colwidth="90.48*"/>
<thead>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="middle"
><p>Name and Description</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="middle"
><p>Return Value</p></entry>
</row>
</thead>
<tbody>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">getFieldValue(item#, field)</codeph
></p><p>Returns a field value in a specific item ID. For example, <codeph
import:style="Literal8">getFieldValue (234, “Found in Build”)</codeph
> returns a <codeph>Found in Build</codeph> field value of <codeph
import:style="Literal8">7415</codeph> for Defect 234.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Depends on field&nbsp;type</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">IsState(statename[, ...])</codeph
></p><p>Returns <codeph import:style="Literal8">true</codeph> if the
item’s state is any of the states specified in the argument list. </p
><p>To specify the unspecified state, type <codeph
import:style="Literal8">"Unspecified"</codeph>. For example, <codeph
import:style="Literal8">IsState("Unspecified")</codeph>.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Boolean</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">IsType()(typename[, ...])</codeph
></p><p>Returns true if the item’s type is any of the types specified
in the argument list. </p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Boolean</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">IsNode()</codeph></p><p>Returns
true if the item is any of type node.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Boolean</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">IsSegment()</codeph></p><p>Returns <codeph
import:style="Literal8">true</codeph> if the item any of type segment.</p
></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Boolean</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">IsSharedItem()</codeph></p><p
>Returns <codeph import:style="Literal8">true</codeph> if the item
is any of type shared item.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Boolean</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">IsContent()</codeph></p><p>Returns <codeph
import:style="Literal8">true</codeph> if the item is any of type content.</p
></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Boolean</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">IsSubsegment()</codeph></p><p
>Returns <codeph import:style="Literal8">true</codeph> if the item
is any of type subsegment.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Boolean</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">IsMeaningful()</codeph></p><p
>Returns <codeph import:style="Literal8">true</codeph> if item any
of type node or segment is meaningful.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Boolean</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">IsNonMeaningful()</codeph></p
><p>Returns <codeph import:style="Literal8">true</codeph> if the item
is any of type node or if segment is non-meaningful.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Boolean</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">IsGroupDocument()</codeph></p
><p>Returns <codeph import:style="Literal8">true</codeph> if the item
is any of type segment that has the Group Document flag set.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Boolean</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">IsTestCase()</codeph></p><p>Returns <codeph
import:style="Literal8">true</codeph> if the item type has a test
management role of Test Case.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Boolean</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">IsTestSession()</codeph></p><p
>Returns <codeph import:style="Literal8">true</codeph> if the item
type has a test management role of Test Session.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Boolean</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">IsTestStep()</codeph></p><p>Returns <codeph
import:style="Literal8">true</codeph> if the item type has a test
management role of Test Step.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Boolean</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><?PubTbl cell border-bottom-width="0.50pt"?><p><codeph
import:style="Literal8">IsTestSuite()</codeph></p><p>Returns <codeph
import:style="Literal8">true</codeph> if the item type has a test
management role of Test Suite.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><?PubTbl cell border-bottom-width="0.50pt"?><p>Boolean</p></entry>
</row>
<row>
<entry><?PubTbl cell border-bottom-width="0.50pt" border-left-width="0.50pt"
border-right-width="0.50pt"?><p><codeph>IsLive()</codeph></p><p>Returns <codeph
>true</codeph> if item type node or segment is live. This function
is useful for specifying live items only in a computation.</p></entry>
<entry><?PubTbl cell border-bottom-width="0.50pt" border-right-width="0.50pt"?><p
>Boolean</p></entry>
</row>
<row>
<entry><?PubTbl cell border-bottom-width="0.50pt" border-left-width="0.50pt"
border-right-width="0.50pt"?><p><codeph>IsVersioned()</codeph></p
><p>Returns <codeph>true</codeph> if the item type node or segment
is versioned. This function is useful for specifying versioned items
only in a computation.</p></entry>
<entry><?PubTbl cell border-bottom-width="0.50pt" border-right-width="0.50pt"?><p
>Boolean</p></entry>
</row>
</tbody>
</tgroup>
</table></section>
<section id="_comp_expression_functions_22430"
import:style="0_TopicSub2"><title>Test Functions</title><table
import:table-style="Format A">
<tgroup cols="2">
<?PubTbl tgroup dispwid="1239.00px"?>
<colspec colname="1" colwidth="393.87*"/><colspec colname="2"
colwidth="91.19*"/>
<thead>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="middle"
><p>Name and Description</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="middle"
><p>Return Value</p></entry>
</row>
</thead>
<tbody>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">TestVerdict(test-verdict-name)</codeph
></p><p>A test verdict name constant that can be used in a comparison.
For example, <codeph import:style="Literal8">LastResult()==TestVerdict(Passed)</codeph
>.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Text</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">TestVerdictByType(verdict-type-name)</codeph
></p><p>A test verdict type constant corresponding to the <codeph
import:style="Literal8">pass</codeph>, <codeph import:style="Literal8"
>fail</codeph>, or <codeph import:style="Literal8">other</codeph>.</p
></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Text</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">TestVerdictName(id)</codeph></p
><p>Returns the display name of the verdict corresponding to the ID.
For example, <codeph import:style="Literal8">TestVerdictName(TestVerdict(Passed)</codeph
> returns <codeph import:style="Literal8">Passed</codeph>; <codeph
import:style="Literal8">TestVerdictName(LastResult())</codeph> returns
the last test result as a string.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Text</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">TestVerdictTypeName(verdict-type-id)</codeph
></p><p>Returns the name of the test verdict type. For example, <codeph
import:style="Literal8">TestVerdictTypeName(TestVerdictByType(pass))</codeph
> returns <codeph import:style="Literal8">Pass</codeph>.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Text</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">VerdictToType(verdict-id-expression)</codeph
></p><p>Returns the numeric verdict type value for the given verdict
ID. You can apply this to <codeph>LastResult()</codeph> to check the
verdict type of a result. For example, <codeph import:style="Literal8"
>VerdictToType(LastResult())==TestVerdictByType(pass)</codeph> indicates
if a result was a pass verdict type.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">ResultCount(test-verdict-name)</codeph
></p><p>Returns the number of test results with a specific verdict.
For example, <codeph import:style="Literal8">ResultCount(Passed)</codeph
> returns the number of successful test results. This function is
intended to be used with test session type items.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">ResultCountByType(verdict-type-name)</codeph
></p><p>Returns the number of test results with a specific verdict
type (<codeph import:style="Literal8">pass</codeph>, <codeph
import:style="Literal8">fail</codeph>, or <codeph
import:style="Literal8">other</codeph>). For example, if you have
two test verdicts with a verdict type of fail, the function <codeph
import:style="Literal8">ResultCountByType(fail)</codeph> returns the
number of test results with either verdict. This function is intended
to be used with test session type items.</p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">ResultCount(Relationship-field,
test-verdict-name)</codeph></p><p>Returns the number of test results
with a specific verdict in related test session type items. </p></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><p><codeph import:style="Literal8">ResultCountByType(Relationship-field,
verdict-type-name)</codeph></p><p>Returns the number of test results
with a specific verdict type (<codeph import:style="Literal8">pass</codeph
>, <codeph import:style="Literal8">fail</codeph>, or <codeph
import:style="Literal8">other</codeph>) in related test session items.</p
></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><p>Integer</p></entry>
</row>
<row>
<entry colname="1" morerows="0" nameend="1" namest="1" valign="top"
><?PubTbl cell border-bottom-width="0.50pt"?><p><codeph
import:style="Literal8">LastResult()</codeph></p><p>Returns the internal
ID of the most recent test result for the current item. This function
must be used with the <codeph import:style="Literal8">TestVerdictName</codeph
> function to convert the internal ID to a display string. For example, <codeph
import:style="Literal8">TestVerdictName(LastResult()).</codeph></p
></entry>
<entry colname="2" morerows="0" nameend="2" namest="2" valign="top"
><?PubTbl cell border-bottom-width="0.50pt"?><p>Integer</p></entry>
</row>
<row>
<entry><?PubTbl cell border-bottom-width="0.50pt" border-left-width="0.50pt"
border-right-width="0.50pt"?><p><codeph import:style="Literal8">LastResultAnnotation()</codeph
></p><p>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, <codeph import:style="Literal8">LastResultAnnotation(sessionID1,
sessionID2, sessionID3, ...)</codeph> returns the annotation of the
most recent test result for the list of one or more session IDs.</p
></entry>
<entry><?PubTbl cell border-bottom-width="0.50pt" border-right-width="0.50pt"?><p
>Text</p></entry>
</row>
<row>
<entry><?PubTbl cell border-bottom-width="0.50pt" border-left-width="0.50pt"
border-right-width="0.50pt"?><p><codeph import:style="Literal8">LastResultSessionID()</codeph
></p><p>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, <codeph import:style="Literal8">LastResultSessionID(sessionID1,
sessionID2, sessionID3, ...)</codeph> returns the session ID of the
most recent test result for the list of one or more session IDs.</p
></entry>
<entry><?PubTbl cell border-bottom-width="0.50pt" border-right-width="0.50pt"?><p
>Integer</p></entry>
</row>
<row>
<entry><?PubTbl cell border-bottom-width="0.50pt" border-left-width="0.50pt"
border-right-width="0.50pt"?><p><codeph import:style="Literal8">LastResultDate()</codeph
></p><p>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, <codeph import:style="Literal8">LastResultDate(sessionID1,
sessionID2, sessionID3, ...)</codeph> returns the date of the most
recent test result for the list of one or more session IDs.</p></entry>
<entry><?PubTbl cell border-bottom-width="0.50pt" border-right-width="0.50pt"?><p
>Date</p></entry>
</row>
<row>
<entry><?PubTbl cell border-left-width="0.50pt" border-right-width="0.50pt"?><p
><codeph import:style="Literal8">LastResultFreezeDate()</codeph></p
><p>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, <codeph import:style="Literal8">LastResultFreezeDate(sessionID1,
sessionID2, sessionID3, ...)</codeph> returns the freeze date of the
most recent test result for the list of one or more session IDs.</p
></entry>
<entry><?PubTbl cell border-right-width="0.50pt"?><p>Date</p></entry>
</row>
</tbody>
</tgroup>
</table><note><p>You can combine <codeph import:style="Literal8">LastResult</codeph
> 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 <codeph>GetFieldValue(LastResultSessionID(),"Project")</codeph
> on the test case.</p></note></section>
</pubsConbody>
</pubsConcept>
