[DC] JQL Functions

[DC] JQL Functions

Functions by type

User

membersOfGroups(group1, group2, groupK)

The function membersOfGroups(group1, group2, groupK) appears to be a method for retrieving members from multiple groups. It likely takes in several group identifiers as parameters and returns a collection of members belonging to those specified groups.

Syntax

membersOfGroups(group1, group2, groupK)

Supported fields

Assignee, Reporter, Voter, Watcher, custom fields of type User

Supported operators

IN , NOT IN

Unsupported operators

= , != , ~ , !~ , > , >= , < , <= , IS , IS NOT , WAS , WAS IN , WAS NOT , WAS NOT IN , CHANGED

Examples

  • Find issues where the Assignee is a member of the group "Jira-administrators":
    assignee in membersOfGroups("Jira-administrators", "Developers")

  • Search through multiple groups and a specific user:
    reporter in membersOfGroups("Jira-administators") or reporter in membersOfGroups("Jira-core-users") or reporter=jsmith

  • Search for a particular group, but exclude a particular member or members:
    assignee in membersOfGroups("Jira-core-users") and assignee not in ("John Smith","Jill Jones")

  • Exclude members of a particular group:
    assignee not in membersOf("Jira-core-users")

^ top of page

usersInRole(project, role)

The function usersInRole(project, role) is likely designed to retrieve a list of users assigned to a specific role within a given project. This could be useful for managing team responsibilities and ensuring that the right individuals are involved in various aspects of the project. The function's parameters include project, which identifies the project in question, and role, which specifies the particular role for which users are being queried.

Syntax

usersInRole(project, role)

Supported fields

Assignee, Reporter, Voter, Watcher, custom fields of type User

Supported operators

IN , NOT IN

Unsupported operators

= , != , ~ , !~ , > , >= , < , <= , IS , IS NOT , WAS , WAS IN , WAS NOT , WAS NOT IN , CHANGED

Examples

  • usersInRole(INTDEV, 'Developer')

  • project in (INTDEV, DEV, MKT) and usersInRole('Developer') - projects use from query context

^ top of page

userMatch(pattern*)

 

Syntax

userMatch(pattern*)

Supported fields

Assignee, Reporter, Voter, Watcher, custom fields of type User

Supported operators

IN , NOT IN

Unsupported operators

= , != , ~ , !~ , > , >= , < , <= , IS , IS NOT , WAS , WAS IN , WAS NOT , WAS NOT IN , CHANGED

Examples

 

^ top of page

projectLeads(project1, project2)

projectLeads(project1, project2)-

 

Syntax

projectLeads(project1, project2)

Supported fields

Assignee, Reporter, Voter, Watcher, custom fields of type User

Supported operators

IN , NOT IN

Unsupported operators

= , != , ~ , !~ , > , >= , < , <= , IS , IS NOT , WAS , WAS IN , WAS NOT , WAS NOT IN , CHANGED

Examples

 

^ top of page

inactiveUsers(key|username|display name|email)

 

 

Syntax

inactiveUsers(key|username|display name|email)

Supported fields

Assignee, Reporter, Voter, Watcher, custom fields of type User

Supported operators

IN , NOT IN

Unsupported operators

= , != , ~ , !~ , > , >= , < , <= , IS , IS NOT , WAS , WAS IN , WAS NOT , WAS NOT IN , CHANGED

Examples

 

^ top of page

componentLeads(project, component1, component2)

 

 

 

Syntax

componentLeads(project, component1, component2)

Supported fields

Assignee, Reporter, Voter, Watcher, custom fields of type User

Supported operators

IN , NOT IN

Unsupported operators

= , != , ~ , !~ , > , >= , < , <= , IS , IS NOT , WAS , WAS IN , WAS NOT , WAS NOT IN , CHANGED

Examples

 

^ top of page

jsmUsers()

The function jsmUsers() is designed to retrieve user data from the system. It plays a crucial role in managing user information efficiently. By calling this function, developers can access a comprehensive list of users, which can then be utilized for various purposes such as analytics, reporting, or user management tasks.

 

Syntax

jsmUsers()

Supported fields

Assignee, Reporter, Voter, Watcher, custom fields of type User

Supported operators

IN , NOT IN

Unsupported operators

= , != , ~ , !~ , > , >= , < , <= , IS , IS NOT , WAS , WAS IN , WAS NOT , WAS NOT IN , CHANGED

Examples

 

^ top of page

jswUsers()

 

Syntax

jswUsers()

Supported fields

Assignee, Reporter, Voter, Watcher, custom fields of type User

Supported operators

IN , NOT IN

Unsupported operators

= , != , ~ , !~ , > , >= , < , <= , IS , IS NOT , WAS , WAS IN , WAS NOT , WAS NOT IN , CHANGED

Examples

 

^ top of page

usersWithProperty('color', 'red')

 

Syntax

usersWithProperty('color', 'red')

Supported fields

Assignee, Reporter, Voter, Watcher, custom fields of type User

Supported operators

IN , NOT IN

Unsupported operators

= , != , ~ , !~ , > , >= , < , <= , IS , IS NOT , WAS , WAS IN , WAS NOT , WAS NOT IN , CHANGED

Examples

 

^ top of page

Group

groupsOfUser(user)

groupsOfUser(user) is a custom JQL function that returns a list of Jira groups that a specific user belongs to. This function is useful for filtering issues based on group membership.

 

Syntax

groupsOfUser(user)

Supported fields

Custom fields of type Group

Supported operators

IN , NOT IN

Unsupported operators

= , != , ~ , !~ , > , >= , < , <= , IS , IS NOT , WAS , WAS IN , WAS NOT , WAS NOT IN , CHANGED

Examples

group IN groupsOfUser("john.doe")

This query retrieves all groups that the user john.doe is a member of.

group IN groupsOfUser(currentUser())

This query retrieves all groups for the currently logged-in user.

Parameters:

  • user (optional) – The username or account ID of the user whose group memberships should be retrieved.

    • If omitted, it defaults to currentUser().

Use Cases:

  • Finding user group memberships to manage permissions or team assignments.

  • Creating dynamic queries that adjust based on a user's group membership.

  • Filtering issues by teams or departments using group-based access control.

^ top of page

groupMatch(pattern)

groupMatch(pattern) is a custom JQL function that allows you to filter and retrieve groups based on a pattern match in Jira. It helps find groups whose names match a specified pattern, making it easier to work with groups that follow a specific naming convention.

 

 

Syntax

groupMatch(pattern)

Supported fields

Custom fields of type Group

Supported operators

IN , NOT IN

Unsupported operators

= , != , ~ , !~ , > , >= , < , <= , IS , IS NOT , WAS , WAS IN , WAS NOT , WAS NOT IN , CHANGED

Examples

group IN groupMatch("dev*")

This query retrieves all groups whose names start with "dev", such as "dev-team", "dev-ops", etc.

Parameters:

  • pattern (required) – A string pattern to match group names.

    • Supports wildcards such as * (matches any characters) or ? (matches a single character).

Use Cases:

  • Finding groups related to a specific team or function, for example, all groups starting with "dev" for development teams.

  • Automating queries based on group naming conventions (e.g., "admin", "support").

  • Managing group memberships by targeting groups with certain prefixes or keywords.

^ top of page

Component

componentMatch(pattern)

componentMatch(pattern) is a custom JQL function used to filter components in Jira based on a pattern match for the component name. It allows you to search for components whose names match the specified pattern, making it easier to find components without needing to list each one explicitly.

 

Syntax

componentMatch(pattern)

Supported fields

Component

Supported operators

IN , NOT IN

Unsupported operators

= , != , ~ , !~ , > , >= , < , <= , IS , IS NOT , WAS , WAS IN , WAS NOT , WAS NOT IN , CHANGED

Examples

component IN componentMatch("Backend*")

This query retrieves all components whose names start with "Backend", such as "Backend API", "Backend Services", etc.

Parameters:

  • pattern (required) – A string pattern used to match component names.

    • The pattern can include wildcards such as * (matches any characters) or ? (matches a single character).

Use Cases:

  • Finding components related to specific categories (e.g., components starting with "UI" or "API").

  • Creating dynamic filters that automatically include new components following a naming pattern.

  • Grouping similar components based on their names, which is useful for organizing large numbers of components.

^ top of page

activeComponents('PRJ', 'INT', 'DEV')

activeComponents('PRJ', 'INT', 'DEV') is a custom JQL function used to filter components that are active in specific projects. This function retrieves components that are currently active (not archived) within the specified projects.

 

Syntax

activeComponents('PRJ', 'INT', 'DEV')

Supported fields

Component

Supported operators

IN , NOT IN

Unsupported operators

= , != , ~ , !~ , > , >= , < , <= , IS , IS NOT , WAS , WAS IN , WAS NOT , WAS NOT IN , CHANGED

Examples

component IN activeComponents('PRJ', 'INT', 'DEV')

This query retrieves all active components within the projects PRJ, INT, and DEV.

Parameters:

  • 'PRJ', 'INT', 'DEV' (required) – A list of project keys for which you want to search for active components. You can include multiple project keys, separated by commas.

Use Cases:

  • Finding active components in multiple projects for reporting or analysis.

  • Filtering components that are still in use or need further action, like bug fixes or feature updates.

  • Tracking current development work by focusing on active components in specific projects.

^ top of page

archivedComponents('PRJ', 'INT', 'DEV')

archivedComponents('PRJ', 'INT', 'DEV') is a custom JQL function that filters components in archived projects. This function allows you to search for components that have been archived within specified projects.

 

Syntax

archivedComponents('PRJ', 'INT', 'DEV')

Supported fields

Custom fields of type Group

Supported operators

IN , NOT IN

Unsupported operators

= , != , ~ , !~ , > , >= , < , <= , IS , IS NOT , WAS , WAS IN , WAS NOT , WAS NOT IN , CHANGED

Examples

component IN archivedComponents('PRJ', 'INT', 'DEV')

This query retrieves all components that have been archived within the specified projects: PRJ, INT, and DEV.

Parameters:

  • 'PRJ', 'INT', 'DEV' (required) – The list of project keys for which archived components should be searched. You can include multiple project keys, separated by commas.

Use Cases:

  • Finding archived components in multiple projects for reporting or cleanup purposes.

  • Tracking legacy components that may no longer be in active use but still exist in the system.

  • Managing old or unused components in projects that have been archived or are no longer active.

^ top of page

Project

projectMatch(pattern)

projectMatch(pattern) is a custom JQL function designed to filter projects by matching patterns in their names. This function proves invaluable for dynamically selecting projects that adhere to specific naming conventions, eliminating the need to list each project individually.

 

Syntax

projectMatch(pattern)

Supported fields

Project

Supported operators

IN , NOT IN

Unsupported operators

= , != , ~ , !~ , > , >= , < , <= , IS , IS NOT , WAS , WAS IN , WAS NOT , WAS NOT IN , CHANGED

Examples

project IN projectMatch("HR*")

This query retrieves all projects with names that begin with "HR", including examples like "HR System" and "HR Requests".

Parameters:

  • pattern (required) – A string pattern used to match project names.

    • The pattern may incorporate wildcards such as * (which matches any sequence of characters) or ? (which matches a single character).

Use Cases:

  • Identifying related projects that adhere to a specific naming convention (e.g., projects that begin with "Sales" or "Support").

  • Developing dynamic filters that automatically incorporate new projects that follow an established naming pattern.

  • Organizing similar projects without the necessity of manually enumerating them.

^ top of page

projectWithUserInRole(user, projectRole)

projectWithUserInRole(user, projectRole) is a custom JQL function that returns a list of projects where a specified user has a given project role.

 

Syntax

projectWithUserInRole(user, projectRole)

Supported fields

Project

Supported operators

IN , NOT IN

Unsupported operators

= , != , ~ , !~ , > , >= , < , <= , IS , IS NOT , WAS , WAS IN , WAS NOT , WAS NOT IN , CHANGED

Examples

This query retrieves all projects where the current user has the role "Developers".

Parameters:

  • user (optional) – The username or account ID of the user. If omitted, it defaults to currentUser().

  • projectRole (required) – The name of the project role (e.g., "Administrators", "Developers", "Testers").

Use Cases:

  • Finding projects where a user has a specific role, such as an administrator or developer.

  • Managing permissions by identifying which projects a user is assigned to.

  • Creating reports for team-based project assignments.