JIRA JQL, more flexible tracking of defects, issues, tasks. . . (1/4)

If you are a developer who understands SQL

The operation of Atlassian JQL is very similar to SQL, but it should not be confused with Java Query Languge. The search box is equipped with code hints and inline validation, which makes it easier to build queries. Try a JQL  JIRA instance, you can:

  • Login to JIRA
  • click question
  • Click Edit (if you have an ongoing search)
  • Click on Advanced Search

You can enter your query directly into JIRA, for a full example, into advanced search . Since I always go to this page for fuzzy searches, I saved this page to bookmarks. This page provides a lot of information, and it is helpful to type "Ctrl + F" to this page and search, jumping directly to the topic or keyword of interest.

What about people who don't understand SQL?

For non-technical users, JQL is just as easy to use for you. JQL is a very easy to use natural language, let's use a simple example to help explain some basic concepts. If you walk into an unfamiliar grocery store, you can ask someone "Where can I find a three-pack of Danone cookies?" The waiter will take you to the right aisle to find the cookies you want. JIRA can also solve the same problem.

JIRA has both simple and advanced searches. Simple Search lets users fill out a series of forms. Advanced search is achieved by using the query language JQL. Retrieval is a more complex problem consisting of a series of simple problems. Searches have three basic parts: fields, operators, and values. You can optionally use some select keywords to link them together. Next let's discuss the specific meaning of each noun, and I have linked the help document of JQL for each noun.

Fields - contain different types of information on the system. In JIRA fields can contain priority, version number, issue type, etc.

Operators - Operators are the foundation of a query. They associate fields with values. Common operators are equals (=), inequality (!=), less than (<) and so on.

Numeric - Contains the actual numeric value of the query. They are usually what we are looking for.

Keywords - Keywords are words that have a specific meaning in a search sentence. In this article we will focus on AND and OR.

Screen Shot 2013-04-12 at 3.59.43 PM

If you use a connective keyword, it should be followed by a field-operator-value search clause. Going back to the previous example, to find a three-pack of Danone biscuits, we would ask the clerk three questions.

  •     What's in the store from Danone?
  •     What's in the AND store are cookies?
  •     What does the AND store have in three packs?

We can represent the query with the following visual Venn diagram. What we are interested in is the central area where the three circles intersect.

 

In the first part of the example, we filled in the field with the company name. The equal sign is an operator. danone is the value of our query. If we wanted to systematically ask the clerk questions, we could say:

company = acme AND itemtype="cookie" AND packagequantity = 3

In the above example, the query requires that the company must be danone, the thing must be a cookie, and the quantity must be 3. Connect each condition with AND. This means that both the left and right sides of the AND must be satisfied at the same time. Because we want to find something that meets all three criteria we use the keyword AND. You can also use OR, which means only one condition needs to be met. If you're looking for discounted items or store brands, we can use an OR query.

 

Using AND will give you the intersection of the two circles, OR will give you the full part of the two circles, I always just use AND, but sometimes OR is very useful too. You'll get fewer results with AND, and more with OR.

Let's go back to JIRA, shall we?

Effectively managing a dynamic project requires some specific metrics from the issue tracker associated with your project. JIRA provides many fields . Click the "Fields" link and you can see the types of data that can be mined from JIRA. Let's take a simple example.
What bug did John Smith record in the Pipeline project yesterday?
reporter = jsmith AND project = Pipeline
In this example, the information about the person who logged the bug is stored in the reporter field, and JIRA has a project field that matches the key information of the issue. For example, PIPELINE-2 is in the PIPELINE project. We can create two conditions and add the AND keyword.
Many times, you may want to query for a set of information. Let's look at a slightly more complicated example.
In projects A, B, C, what bugs are blocker and critical?
priority IN (Blocker, Critical) AND project IN (ProjA, ProjB, ProjC)
IN gives all the problems that contain the keywords in the list, in the above example, it will return all blockers and critical bugs in A, B, C in the project.
What kind of questions on the last day were unassigned and not updated?
assignee IS EMPTY AND created < -1d
In this query, the empty statement shows all issues where the assignee field value is blank. JIRA also supports relative dates. -1d represents the day before the query day. The query above will return all unassigned issues that are at least one day old.

Enter JQL in JIRA

JIRA's JQL editor makes learning JQL easier. The code editor prompts you as you type. For new users, this greatly simplifies the learning process and makes it easy to get started. The JQL editor knows to recognize the input query information and gives immediate query results.

For example, if we want to enter the following JQL statement:

project = Pipeline

JIRA gives hints at each step of the three components of our query. When you see the value you want to select, you can use the arrow keys or the mouse to select it.

 

When the query statement is entered, JIRA will verify the JQL, and the green check mark to the left of the text input box indicates that the syntax is correct.

 

"Syntax Help" will link to JIRA 's syntax reference page.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326321476&siteId=291194637