Document generation for Jira enables you to perform common manipulations on sequential data. You can group, sort, and perform other sequential data manipulations in template expressions.
Selector
stands for a lambda function returning a value and taking an enumeration item as its single argument.ComparableSelector
stands forSelector
returning IComparable.Predicate
stands forSelector
returning a boolean value (true or false).
...
all(Predicate)
...
any()
...
persons.any()
...
any(Predicate)
...
average(Selector)
...
...
concat(IEnumerable)
...
persons.concat(otherPersons)
An implicit reference conversion must exist between types of items of concatenated enumerations.
...
contains(Object)
...
count()
...
count(Predicate)
...
dayOfWeek(issue.created)
Human readable day of week. Ex: Monday
...
distinct()
...
first()
...
first(Predicate)
...
firstOrDefault()
...
firstOrDefault(Predicate)
...
formatDate
...
formatDate(issue.created)
will produce May/27/2019 Format can be changed on Configuration page of the app, the Date format setting.
...
will produce May/27/2019 10:18 AM Format can be changed on Configuration page of the app, the Date time format setting.
...
groupBy(Selector)
...
persons.groupBy(p => p.age)
Or
persons.groupBy(
p =>
new
{
age = p.age,
count = p.children.Count()
})
...
last()
...
last(Predicate)
...
lastOrDefault()
...
lastOrDefault(Predicate)
...
max(ComparableSelector)
...
min(ComparableSelector)
...
Document generation for Jira enables you to perform common manipulations on sequential data. You can group, sort, and perform other sequential data manipulations in template expressions.
Selector
stands for a lambda function returning a value and taking an enumeration item as its single argument.ComparableSelector
stands forSelector
returning IComparable.Predicate
stands forSelector
returning a boolean value (true or false).
Extention method | Examples and notes | |
---|---|---|
| persons.all(p => p.age < 50 ) | |
|
| |
| persons.any(p => p.name == "John Smith") | |
| persons.average(p => p.age) The input selector must return a value of any type that has predefined or user-defined addition and division operators. | |
|
An implicit reference conversion must exist between types of items of concatenated enumerations. | |
| persons.contains(otherPersons.first()) | |
| persons.count() | |
| persons.count(p => p.age > 30) | |
dayOfWeek |
Human readable day of week. Ex: Monday | |
| persons.distinct() | |
| persons.first() | |
| persons.first(p => p.age > 30) | |
| persons.firstOrDefault() | |
| persons.firstOrDefault(p => p.age > 30) | |
|
will produce May/27/2019 Format can be changed on Configuration page of the app, the Date format setting. | |
formatDate Time | formatDateTime(issue.created) will produce May/27/2019 10:18 AM Format can be changed on Configuration page of the app, the Date time format setting. | |
|
Or persons.groupBy( p => new { age = p.age, count = p.children.Count() }) This method returns an enumeration of group objects. Each group has a unique key defined by the input selector and contains items of the source enumeration associated with this key. You can access the key of a group instance using the Key property. You can treat a group itself as an enumeration of items that the group contains. | |
indexOf() | {{foreach [issue in issues]}}{{[issue.indexOf() != 0 ? ", " : ""]}}{{[issue.issuekey]}}{{/foreach}} Get index of element in list. Example above prints issue keys. If position of element in list not equal to zero, then comma will be printed before it. | |
| persons.last() | |
| persons.last(p => p.age > 100) | |
| persons.lastOrDefault() | |
| persons.lastOrDefault(p => p.age > 100) | |
|
| |
|
| |
|
Or persons.orderBy(p => p.age) .thenByDescending(p => p.name) Or persons.orderBy(p => p.age) .thenByDescending(p => p.name) .thenBy(p => p.children.count()) This method returns an enumeration ordered by a single key. To specify additional ordering keys, you can use the following extension methods of an ordered enumeration:
| |
|
Or persons.orderByDescending(p => p.age) .thenByDescending(p => p.name) Or persons.orderByDescending(p => p.age) .thenByDescending(p => p.name) .thenBy(p => p.children.count()) => p.age) .thenByDescending(p => p.name) .thenBy(p => p.children.count()) See the previous note. | |
overtimeHours(seconds, hours) | {{[overtimeHours ( Prints overtime hours calculated from seconds. Second parameter, 8 in this case, stands for maximum regular hours. Everything over this number will be treated overtime. | |
regularHours(seconds, hours) | {{[regularHours ( Prints regular hours calculated from seconds. Second parameter, 8 in this case, stands for maximum regular hours. Everything over this number will be treated overtime. | |
| persons.single() | |
| persons.single( p => p.name == "John Smith" ) | |
| persons.singleOrDefault() | |
|
| |
| persons.skip( 10 ) | |
| persons.skipWhile(p => p.age < 21 ) | |
|
The input selector must return a value of any type that has a predefined or user-defined addition operator. | |
| persons.take(5) | |
| persons.takeWhile(p => p.age < 50) | |
toHours |
Converts number of seconds to hours/minutes, e.g. "3720" becomes "1h 2m" | |
|
An implicit reference conversion must exist between types of items of united enumerations. | |
weekOfYear |
Number of week in a year | |
| persons.where(p => p.age > 18 ) |