Apps documentation
Active Directory Attributes Sync
Active Directory Attributes Sync
Documentation
FAQ
Release notes
Last updated Mar 10, 2022

Using synchronized data in JQL

Learn how to search for synchronized data in Jira using JQL

Active Directory Attributes Sync adds a searchFromAD JQL function. It’s the most efficient way to search for issues with specific attributes synchronized with your Active Directory server. You may also search for users participating in those issues.

This function can be used in any place in Jira where using JQL is available: in the Issue Navigator, in a Saved Filter, as an Agile Board query, etc.

Note

Remember to always put query parameters in straight quotation marks (" ").

Info

For more information about JQL searching, see the official Atlassian documentation on Advanced Searching and Advanced Searching Functions.

Query format

User-oriented syntax

To specify a searching condition for a user, use the following format:

user in searchUsersFromAD("attribute","attribute value")

Definitions

Function argument Description
user It can be assignee, reporter or "Request participants"
attribute The attribute from Active Directory.
attribute’s value The value of the attribute. It can evaluate to exact value or operators: "NOT_EMPTY", "*" (which means that the attribute has any value), "EMPTY", "" (attribute doesn’t have any value), or "user(userid)" (where userid is either username or displayName)
Note

"Request participants" must always be put in quotes.

Issue-oriented syntax

There is another way of building a similar query to find issues with synchronized AD data. This syntax makes searches a bit slower, but generally it brings the same results. It is also useful when searching for specific custom fields.

issue in searchFromAD("customfield","attribute","attribute value")

Definitions

Function argument Description
customfield The custom field of following types: user picker, multi user picker, request participants. It can be also an assignee or reporter.
attribute The attribute from Active Directory to search.
attribute’s value The value of the attribute. It can evaluate to exact value or operators: "NOT_EMPTY", "*" (which means that the attribute has any value) or "EMPTY", "" (attribute doesn’t have any value).
Note

If you search for attributes containing users (for example, Manager) you need to provide a username (not the full name in Jira). For example, in the following query searchFromAD("reporter", "Manager", "X") the “X” must be the username, not the full name of the Jira user.

Examples

Here are some examples of a JQL query to find specific issues.

Tip

We always recommend the user-oriented syntax as more efficient, but the issue-oriented format is also available for specific queries, for example those targeted at custom fields.

query user-oriented syntax issue-oriented syntax
To find issues where the assignee is an employee from Wroclaw: assignee in searchUsersFromAD("City","Wroclaw") issue in searchFromAD("assignee","City","Wroclaw")
To find issues where the reporter’s job title is Software Developer: reporter in searchUsersFromAD("Job title","Software developer") issue in searchFromAD("reporter","Job title","Software developer")
To find all issues assigned to people reporting to the currently logged in user: assignee in searchUsersFromAD("Manager", "currentUser()") issue in searchFromAD("Assignee", "Manager", "currentUser()")
To find issues where the assignee is an employee who works in one of the following departments: Support, Super Department, Support&Developement etc., add the fourth parameter: “LIKE”: assignee in searchUsersFromAD("Department","Sup","LIKE") issue in searchFromAD("assignee","Department","Sup","LIKE")
To find request participants that are software developers: "Request participants" in searchUsersFromAD("Job title","Software developer") issue in searchFromAD("Request participants","Job title","Software developer")
To find issues where the assignee is an employee whose company that starts with specific letters: assignee in searchUsersFromAD("Company","De","STARTS_WITH") issue in searchFromAD("Assignee","Company","De","STARTS_WITH")
To find issues where the reporter’s telephone number ends with specific numbers: reporter in searchUsersFromAD("Telephone Number","886","ENDS_WITH") issue in searchFromAD("reporter","Telephone Number","886","ENDS_WITH")
To find request participants that work in a certain department: "Request participants" in searchUsersFromAD("Department","Apps") issue in searchFromAD("Request participants","Department","Apps")
To find issues with a particular custom field that contains a user (when you know the exact ID of that custom field): "customfield_10200" in searchUsersFromAD("Company","Deviniti") issue in searchFromAD("customfield_10200","Company","Deviniti")
To find issues with the custom field Developer, containing a user who works in the Deviniti company: "Developer" in searchUsersFromAD("Company","Deviniti") issue in searchFromAD("Developer","Company","Deviniti")
To find issues where one of the worklog authors is an employee from Wroclaw: worklogAuthor in searchUsersFromAD("City","Wroclaw") not available

currentUser()

The “currentUser()” function makes it possible to create dynamic dashboards, based on who is currently logged into Jira.

For example, when an IT manager logs into Jira they will be able to see all the bugs that are assigned to engineers reporting to them.

Example of a query

project = HR and issue in searchFromAD("Assignee", "Manager", "currentUser()")

Note

Remember to put the "currentUser()" function in quotes. You can use one of the following formats:

  • "currentUser()"
  • "CURRENT_USER"
Info

For more information on how to find the ID of a custom field, see the official Atlassian documentation.

Need help?

If you can’t find the answer you need in our documentation, raise a support request.