A Time in status custom field type represents a duration and is displayed either as a duration String or as a number in a Long format representing the number of seconds. It is a read-only field. |
To add a Time in status custom field type to your instance:
Issues - > Custom fields.
Add custom field
.Advanced
in the left panel. Time in status Field type
and select it.Next
.Create
Configure
and specify the Status(es) to look for (explained below).When creating a Time in status custom field type, you can configure the Search template as
Using these searchers you will be able to search for issues within a range of values for that custom field. The default search template is Duration searcher (24x7 durations). If you select “None”, then you won’t see any reference to this field in the Issue Navigator search fields. Note that changing a custom field searcher requires a re-index.
Duration searcher (24x7 durations) is a custom statistics compatible searcher provided by JMCF that allows Duration type custom fields of JMCF to be used in the statistics gadgets. See here for more information.
To specify the status(es) to look for:
Configure
Edit Status(es) to look for.
Save.
You can also configure the custom field to look for the current status by selecting the current status in the configuration. |
To remove the status(es) to look for:
Configure
Edit status(es) to look for.
Save
.For a Time in status field, the Search Template also determines how durations are displayed, and how duration strings returned by the formula are parsed. By default, the search template is Duration searcher (24x7 durations). However, you can customize it by changing the Search template. When you select the template,
144000
seconds is displayed as 1day, 16hours
.You can define a velocity template that will return the Html representation of the calculated custom field. Leave it empty to use the default template.
To select a format for a Time in status custom field type value;
Configure
Edit Velocity Template
.Save.
You can use the following Velocity variables in the template:
$value
: the raw field value, the number of seconds$formattedValue
: the field value formatted according to the field configuration aboveFor example:
<div style="border: dashed"> $formattedValue </div> |
displays the formatted value of the field with a dashed border.
Displaying the Time in status custom field type on Transition and Edit screen
The Never show on Transition and Edit screens
option controls whether the Time in status custom field can appear on transition and edit screens. If you select this option, the field will not be visible on any Edit or Transition screen, even if it is added to the screen.
Accessing the Time in Status custom field from other Groovy scripts
You can access this field using any of the following getters of the Issue interface
get("Your custom field name") or get("customfield_xxxxx")
that returns a number in a Double format.
getAsString("Your custom field name")
or
getAsString("customfield_xxxxx")
that returns a String
representing the duration in number of seconds