count()

Number list

This function returns the number of elements in a number list.

Bash
count(numberList) #Output: Number

Examples

Parser expression

Description

Bash
count([1, 1, 2, 2])

This example returns

4

Bash
count(subtasks()) - count(fieldValue({00012}, subtasks())) 

This example returns the number of sub-tasks with an empty "Due Date".

To achieve this, the following functions are used:

Additional information

Parameters used in this function

Parameter

Input (data type)

Description

numberList

number list

Any given number list.

Output

This function returns a number

Number in number list

This variant counts how often a given number appears in a number list.

Bash
count(number, numberList) #Output: Number

Examples

Parser expression

Description

Bash
count(1, [1, 1, 2, 2, 1, 0]

This example returns 

3

Additional information

Parameters used in this function

Parameter

Input (data type)

Description

number

number

Any given number.

numberList

number list

Any given number list.

Output

This function returns a number

Text list

This function returns the number of elements in a text list.

Bash
count(textList) #Output: Number

Examples

Parser expression

Description

Bash
count(["blue", "red", "blue", "black"])

This example returns

4

Bash
count(distinct(fieldValue(%{00094}, subtasks())))

This example returns the number of components selected among all sub-tasks.

To achieve this, the following functions are used:

Additional information

Parameters used in this function

Parameter

Input (data type)

Description

textList

text list

Any given text list.

Output

This function returns a number

Text in text list

This variant counts how often a given text appears in a text list.

Bash
count(text, textList) #Output: Number

Examples

Parser expression

Description

Bash
count("blue", ["blue", "blue", "red", "red", "blue", "green"])

This example returns 

3

Additional information

Parameters used in this function

Parameter

Input (data type)

Description

text

text

Any given text.

textList

text list

Any given text list.

Output

This function returns a number

Issue list

This functions returns the number of elements in a given issue list.

Bash
count(issueList) #Output: Number

Examples

Parser expression

Description

Bash
count(subtasks())

This example returns the number of all subtasks.

To achieve this, the following function is used:

Bash
count(filterByIssueType(subtasks(), "Technical task"))

This example returns the number of all subtasks that are Technical tasks.

To achieve this, the following functions are used:

Bash
count(linkedIssues("is blocked by"))

This example returns the number of all linked blocking issues.

To achieve this, the following functions are used:

Bash
count(filterByResolution(linkedIssues("is blocked by"), ""))

This example returns the number of unresolved blocking issues.

To achieve this, the following functions are used:

Additional information

Parameters used in this function

Parameter

Input (data type)

Description

issueList

issue list

Any given issue list. Usually this value is retrieved from a function (e.g. linkedIssues() or subtasks()).

Output

This function returns a number

📚 Use cases and examples

Use case Workflow function Field type Automated action Parser functions
Prevent a transition depending of the number of components

Logical validator

Logical condition

numberOfSelectedItems()

Number of unresolved blocking issues

Number

count()

filterByResolution()

linkedIssues()

Close epic when stories are done

Transition issue action

count()

filterByStatus()

issuesUnderEpic()

Block an Epic's transition until all the issues under that Epic are resolved

Logical validator

Logical condition

count()

issuesUnderEpic()

filterByResolution()

Block an Epic's transition depending on linked issues status and due date

Logical validator

Logical condition

count()

filterByPredicate()

linkedIssues()

Number of times a custom field has been changed

Number

count()

fieldChangeTimes()

Ensure that all issues linked with a certain issue link type have "Due Date" field set

Logical validator

Logical condition

count()

linkedIssues()

fieldValue()

Number of issues in the same version

Number

count()

issuesFromJQL()

Prevent issue creation with the same field value (Boolean)

Logical validator

Validation based on JQL query

count()

issuesFromJQL()

Validate only issue links created in transition screen

Logical validator

count()

transitionLinkedIssues()

filterByProject()

filterByIssueType()

Create several issues combining fields

Create issue

nthElement() toStringList() modulus() count() ceil()

Reject duplicated file names in attachments

Logical validator

Logical condition

count()

toStringList()

distinct()

Number of times a resolved issue has been rejected

Number

count()

timesOfTransition()

Automatically close parent when all sub-tasks are done

Transition issue action

count()

filterByStatus()

siblingSubtasks()

Number of open subtasks

Number

count()

filterByPredicate()

subtasks()

Block a transition until all sub-tasks have certain fields populated

Logical validator

Logical condition

count()

filterByPredicate()

subtasks()