5. JQL - JIRA Query Language

5.1. Where to find?

  • Issues -> Search for Issues

    • Basic -> Advanced

    • Detail View -> List View

5.2. Where is used?

  • Searching Issues

  • Board Configuration

  • Filters for Dashboard

  • Filters for Subscriptions

  • Bulk edit (to change limit: echo 'jira.bulk.edit.limit.issue.count = 1000' >> $JIRA_HOME/jira-config.properties)

  • jira.issue.editable = true dla statusu Done (Workflow)

5.3. Operators

Table 5.1. Operators

Operator

Description

!=

Not equal (is different than)

==

Equals

=

Equals

>

Greater than

<

Less than

<=

Greater or equal

>=

Less or equal

5.4. View

  • Konfiguracja Kolumn wyszukiwania

  • Import / Export CSV

    • All fields

    • current fields

  • Limit wyświetlania wyników dla JQL (change: General Configuration -> Advanced Settings -> jira.search.views.default.max)

5.5. JQL Examples

  • Operators capital letter

5.5.1. Select issues

project = DEMO
status = "To Do"
assignee = admin
reporter = my.username
summary ~ "Hello"
assignee != my.username
statusCategory = "To Do"
statusCategory != "Done"
Flagged IS NOT EMPTY

5.5.2. Complex queries

status = "To Do" OR status = "In Progress"
status IN ("To Do", "In Progress")
status NOT IN ("To Do", "In Progress")
statusCategory NOT IN ("To Do", "In Progress")
project = DEMO
    AND status = "To Do"
project = DEMO
    AND resolution NOT IN (Fixed, "Won't Fix")

5.5.3. Ordering

project = DEMO
    ORDER BY priority DESC
project = DEMO
    ORDER BY priority DESC, key ASC

5.5.4. Functions

currentLogin()
lastLogin()
now()
startOfDay()
startOfWeek()
startOfMonth()
startOfYear()
endOfDay()
endOfWeek()
endOfMonth()
endOfYear()
assignee = currentUser()
Sprint IN closedSprints()
Sprint IN openSprints()
Sprint IN futureSprints()

5.5.5. Queries in History

project = DEMO
    AND status WAS Done
    AND status != Done
project = DEMO
    AND status WAS Done
    AND status != Done
    AND updated > -1d
due >= 2017-03-01 AND due <= 2017-03-31
due >= startOfMonth() AND due <= endOfMonth()
due <= now()
    AND statusCategory != Done
status WAS NOT "In Progress" BEFORE "2011/02/02"
status WAS NOT IN ("Resolved","In Progress") BEFORE "2011/02/02"
status WAS IN ("Resolved","In Progress")
status WAS "Resolved" BY jsmith DURING ("2010/01/01","2011/01/01")
status WAS "Resolved" BY jsmith BEFORE "2011/02/02"
status CHANGED BY currentUser()
AFTER "date"
BEFORE "date"
BY "username"
DURING ("date1","date2")
ON "date"
FROM "oldvalue"
TO "newvalue"
assignee CHANGED
priority CHANGED BY freddo BEFORE endOfWeek() AFTER startOfWeek()
status CHANGED FROM "In Progress" TO "Open"

5.6. Useful Queries

5.6.1. My issues To Do

assignee = currentUser()
    AND statusCategory = "To Do"
assignee = currentUser()
    AND statusCategory = "To Do"
    ORDER BY priority DESC, key ASC
project = DEMO
    AND sprint IN openSprints()
    AND assignee = currentUser()

5.6.2. Tracking reported issues

reporter = currentUser()
    AND statusCategory != Done
    AND assignee != currentUser()

5.6.3. Tracking team members work

statusCategory NOT IN (Done, "In Progress")
    AND assignee IN membersOf("jira-administrators")
project = DEMO
    AND updated >= -7d
    AND assignee IN membersOf("jira-administrators")
assignee IN membersOf("jira-administrators")
    AND updated >= startOfWeek(-7d)
    AND updated <= endOfWeek(-7d)

5.6.4. Daily

project = DEMO
    AND sprint IN openSprints()
    AND (statusCategory = "In Progress" OR Flagged is not EMPTY)
    AND updated >= -1d

5.8. Assignments

5.8.1. JQL i Wyszukiwanie zadań

  1. wyszukaj wszystkie zadania, które są w statusie “In Progress”

  2. wyszukaj zadania, które zostały zaktualizowane od wczoraj

  3. wyszukaj zadania, które należą do obecnie otwartego sprintu

  4. wyszukaj zadania oflagowane

  5. wyszukaj zadania, które należą do osób z grupy jira-administrators

  6. wyszukaj zadania, które były przypisane do Ciebie, ale już nie są

  7. Wyszukaj wszystkie zadania zaktualizowane przez Ciebie w okresie ostatniego tygodnia

  • Pokaż kolumny: Priority, Key, Summary, Original Time Estimate, fixVersion, Epic Name, Status