Message-ID: <1178353434.15982.1711711264650.JavaMail.appbox@confluence> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_15981_1952387111.1711711264650" ------=_Part_15981_1952387111.1711711264650 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html S-JQL Cookbook

S-JQL Cookbook


Here are the most common examples of using S-JQL.

=20 =20

1. Find issues added to a structure

Goal: Suppose that you are using a structure named "My = todo list" as a collection of issues, and you want to see in the Issue Navi= gator all issues added to this structure.

How to achieve: In the Issue Navigator, switch to Advanced Searching and run the following query:

=20
issue i=
n structure("My todo list")
=20

If you want to find issues added to the Default Structure, you can omit the structure name:

=20
issue i=
n structure()
=20

^ up to the list of examples=

2. = Quick Filter for JIRA Agile's (GreenHopper) Scrum Board to display only low= -level issues in a structure

Setup: Suppose that you are using a structure named "Pr= oject work breakdown" to organize tasks under higher-level "container" issu= es that provide an overview of your team's work. In this setting, the actua= l tasks are at the bottom level of the hierarchy. Also, suppose you are usi= ng JIRA Agile's Scrum Board to manage your sprints.

Goal: You want to see only the actual tasks in backlog,= hiding the container issues.

How to achieve: Add a = Quick Filter to your JIRA Agile (GreenHopper) board with the following = JQL:

=20
issue i=
n structure("Project work breakdown", leaf)
=20

If your structure is organized such that two lower levels matte= r to you on the JIRA Agile board, you'll search for leaf issues and their p= arents with this JQL:

=20
issue i=
n structure("Project work breakdown", "leaf or parent of leaf")
=20

^ up to the list of examples=

3. Retrieve all Epics in a certain sta= tus and all of their children

Setup: You have a structure named "Enterprise Portfolio= " with Epics on the top level, Stories beneath them, and Tasks with their S= ub-Tasks occupying the lower levels of the hierarchy.

Goal: You need to see Epics in status Assigned= with all of their children.

How to achieve: In the Issue Navigator, switch to Advanced Searching and run the following query:

=20
issue i=
n structure("Enterprise Portfolio", "issueOrAncestor in [type =3D Epic and =
status =3D Assigned]")
=20

If you want to see these issues in the structure, go to Structure Board and type this query in t= he Search Area in the JQL mode.

Also, you can type only the last part of the query if you use S-JQL search mode:

=20
issueOr=
Ancestor in [type =3D Epic and status =3D Assigned]
=20

^ up to the list of examples=

<= /span>

4. Find Test Cases associated with Storie= s in an active sprint

Setup: Suppose that you have a structure named "Enterpr= ise Portfolio Testing", where you have Epics on the top level, Stories on t= he second level, then come Test Sub-Tasks, and finally Test Cases.
You = are also using JIRA Agile (Greenhopper) to manage your sprints, which conta= in Stories. The fact that a Test Case is associated with an Story is record= ed only in the structure.

Goal: You need to find those Test Cases that are associ= ated with Stories in an active sprint.

How to achieve: You can use Issue Navigator's Advanced Searching capability or open the structure on= the Structure Board and= use its Search Area in the JQL m= ode to run this query:

=20
issue i=
n structure("Enterprise Portfolio Testing", "[type =3D 'Test Case'] and anc=
estor in [type =3D Story and sprint in openSprints()]")
=20

Or, you can type only the last part of the query if you use S-JQL search mode on the Structur= e Board:

=20
[type =
=3D 'Test Case'] and ancestor in [type =3D Story and sprint in openSprints(=
)]
=20

^ up to the list of examples=

5. Find all issues that are blocking critical iss= ues

Setup: Suppose that you have a structure named "Depende= ncy structure" where parent-child relationship corresponds to dependency: e= ach child blocks its parent. (You might have configured a Links Synchronizer to synchronize this= structure with the "Dependency" JIRA issue link.)
Let's also suppose t= hat you consider critical those issues that have priority Critical= .

Goal: You want to see all issues that are blocking crit= ical issues, according to the structure.

How to achieve: You'll need to find children of critica= l issues. You can use Issue Navigator's Advanced S= earching capability or open the structure on the Structure Board and use its Search Area in the JQL mode to run this query:

=20
issue i=
n structure("Dependency structure", "child of [priority =3D Critical]")=20

Or, you can type only the last part of the query if you use S-JQL search mode on the Structur= e Board:

=20
child o=
f [priority =3D Critical]
=20

^ up to the list of examples=

<= /span>

6. Find all unassigned issues in a part of a projec= t

Setup: Suppose that you use a structure named "Project = work breakdown" to break down your project into smaller pieces, so that if = you have an issue somewhere in the structure, all of its children at all le= vels constitute a separate part of a project.

Goal: You are focusing on a part of a project under the= issue with key PROJ-123, and you want to see unassigned issue= s in that part of the project.

How to achieve: Use this JQL query to find all unassign= ed descendants of PROJ-123:

=20
issue i=
n structure("Project work breakdown", "[assignee is empty] and descendant o=
f PROJ-123")
=20

^ up to the list of examples=

7. Top-level view on unfinished parts of a project<= /h4>

Setup: Let's continue with the "Project work breakdown"= structure from the previous example. Suppose that there are several top-le= vel issues representing different parts of the project.

Goal: You want to have a view on the parts of the proje= ct that are yet unfinished.

How to achieve: In the Structure terms, you need to see= the root issues that have unresolved descendants. To have a persistent vie= w, create a Saved Filter with the following JQL:

=20
issue i=
n structure("Project work breakdown", "root and descendants in [resolution =
is empty]")
=20

^ up to the list of examples=

8. Find violations of the = rule "Tasks must be under Epics or Stories"

Setup: You have a structure named "Planning" where you = put issues of types Epic, Story, and Task. Your team follows the convention= that Tasks are always put under Epics or Stories. However, as humans are f= allible, sometimes a Task ends up being in a wrong place =E2=80=94 either o= n the top level, or under another Task.

Goal: You need to find Tasks that violate the rule, so = that you can put them in the right place.

How to achieve: In the Search Area on the Structure Board, run the following JQL search:

=20
issue i=
n structure("Planning", "[type =3D Task] and parent not in [type in (Epic, =
Story)]")
=20

^ up to the list of examples=

9. Find = violations of the rule "An issue cannot be resolved if it has unresolved ch= ildren"

Setup: Suppose that "Planning" is a work breakdown stru= cture. Your team follows the convention that an issue cannot be resolved un= less all of its children are resolved.

Goal: You need to find the issues violating this rule.<= /p>

How to achieve: In the Search Area on the Structure Board, run the following S-JQL search:

=20
[resolu=
tion is not empty] and child in [resolution is empty]
=20

^ up to the list of examples=

10. Find issues that can be re= solved because all their children are resolved

Setup: Suppose that "Planning" is a work breakdown stru= cture. Your team follows the convention that once all children of an issue = are resolved, the issue can be resolved as well.
The best solution for = this would be to use a Status Rollup Synchronizer, but suppose that for some reason you = want to do it manually.

Goal: You need a way to manually resolve those issues t= hat have all of their children resolved.

How to achieve: Open the structure on the Structure Board. When you paste the q= uery given below into the Search Area= (ensure that the JQL = mode is selected), the issues that you can resolve will be shown. You c= an resolve them one by one. Here's the query you need:

=20
issue i=
n structure("Planning", "[resolution is empty] and not(child is empty or ch=
ild in [resolution is empty])")
=20

^ up to the list of examples=

<= /span>

11. Get a view of a second (third, ...) leve= l of the hierarchy

Setup: There is a large structure named "Joint Effort" = where different users track their issues on several levels: Customer Relati= ons department works with the top-level issues, Project Managers break them= down in several issues on the second level, Team Members work with issues = under second-level issues.

Goal: Each user wants to see only the relevant part of = the structure. Customer Relations department wants to filter out lower-leve= l issues to focus on the top-level ones, and Project Managers sometimes wan= t to focus on just the second-level issues in the context of their parent r= equests.

How to achieve: use the Search Area on the Structure Board to run the specific queries (ensure that the S-JQL mode is selected.) Tog= gle the Filter b= utton to hide the issues on the lower levels.

To see top-level issues, run this query:

=20
root=20

To see second-level issues (top-level issues will be still displayed, bu= t greyed out), run this query:

=20
child o=
f root
=20

If you would need to dig even deeper, to see the third level but not the= lower ones, you'd use this query:

=20
child o=
f (child of root)
=20

^ up to the list of examples=

= 12. Get the contents of a folder

Setup: There is a structure with a folder named "Next R= elease". Issues are placed there manually and then queried via S-JQL for pl= anning purposes (as an Agile board filter, for example). 

Goal: The users want to see all issues that are located= under the specified folder.

How to achieve: In the Issue Navigator, switch to= Advanced Searching and run the f= ollowing query:

=20
issue i=
n structure("My Structure", "descendant of folder('next release')")
= =20

Note that the folder name is case-insensitive.

^ up to the list of examples=

------=_Part_15981_1952387111.1711711264650--