Chapter 6. The Power of JIRA Searching

In this chapter, we will cover:

  • Writing a JQL function
  • Sanitizing JQL functions
  • Adding a search request view
  • Smart querying using quick search
  • Searching in plugins
  • Parsing a JQL query in plugins
  • Linking directly to search queries
  • Indexing and de-indexing issues programmatically
  • Searching on issue entity properties
  • Managing filters programmatically
  • Subscribing to a filter

Introduction

JIRA is known for its search capabilities. It also allows us to extend these capabilities in a way that impresses its users! In this chapter, we will look at customizing the various searching aspects of JIRA, such as JQL, searching in plugins, managing filters, and so on.

JQL, JIRA Query Language, brings to the table advanced searching capabilities. The users can search for issues in their JIRA instance and then exploit all the capabilities of the issue navigator.

While JIRA has a Simple or Basic Searching that can be used for most searching requirements, JQL, or Advanced Searching, introduces support for logical operations, including AND, OR, NOT, NULL, and EMPTY. It also introduces a set of JQL functions, which can be used effectively to search based on predefined criteria.

JQL is a structured query language that lets us find issues using a simple SQL-like syntax. It is simple because of its auto-complete features, and it is powerful because of the custom JQL functions. As Atlassian puts it:

"JQL allows you to use standard Boolean operators and wild cards to perform complex searches, including fuzzy, proximity, and empty field searches. It even supports extensible functions, allowing you to define custom expressions like currentUser() or lastSprint() for dynamic searches."

A query in Advanced Search consists of a field, followed by an operator, followed by a value or function. To find out all issues in a project, we can use:

project = "TEST"

Here, project is the field, = is the operator, and TEST is the value.

Similarly, we can find all issues assigned to the current user using the following:

assignee = currentUser()

Here, assignee is the field, = is the operator, and currentUser()is a JQL function.

At this point in time, JQL doesn't support the comparison of two fields or two functions in a single query. But we can use logical operators and keywords to introduce more control, as follows:

project = "TEST" AND assignee = currentUser()

This query will display issues that are in the project TEST and that have the current user as the assignee. A more detailed explanation on Advanced searching, along with the full reference to the keywords, operators, fields, and functions used can be found at https://confluence.atlassian.com/jira/advanced-searching-179442050.html.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.62.161