Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


On this page you cand find searches for:

Table of Contents

With the introduction of version 4.0, we unlocked a very powerful mechanism to search your issues, in ways you never believed possible. Here is our guide on how to build your searches.

...

Warning
titleSearch Performance

For performance reasons, put there a filter that keeps the potential number of matching issues as low as possible. Remember that running a script over an issue is more complex than simply comparing values.

...


Issues with comments

To return issues with comments  for a given project we can use this simple JQL:

...

Code Block
titleJQL
key in silJQLExpression("size(getAllCommentIds(key)) == 5", "project = TEST")

...


Issues by atributes of their comments

In order to find issues that have been commented after a specified date, we need to create a SIL script with the following code:

...

Code Block
titleJQL
key in silJQLList("commented.sil", TEST, 2w, admin)

...

Issues by the user who last updated the comments

Code Block
titlelastUpdated.sil
string [] keys = selectIssues("project = " + argv[0]);
string [] ret;
for(string k in keys) {
    number [] commentIds = getAllCommentIds(k);
    if(size(commentIds) != 0) { 
        for(number id in commentIds) {
            JComment comment = getCommentById(id);
            if(userInGroup(argv[1], comment.updatedBy)) {
                ret += k;   
            }
        }
    } 
}
return ret;

...

Code Block
titleJQL
key in silJQLList("lastUpdated.sil", TEST, jira-administrators)

...

Issues by worklogs

If we want to find the issues where work had been logged by a specified user. We can do this by using silJQLExpression:

...

Also, we can use this JQL to find the issues where work had been logged on a given date:

Code Block
titleJQL
key in silJQLExpression('size(getWorklogIds("2017-03-16", key)) != 0', 'project = TEST')

...

Issues with attachments

To return issues with attachments for a given project we can use this simple JQL:

Code Block
titleJQL
key in silJQLExpression('size(attachments) != 0', 'project = TEST')

...

In order to find the issues that are linked we can use the following JQL:

...

Code Block
titleJQL
key in silJQLExpression('size(linkedIssues(key, "Relates")) != 0', 'project = TEST')

To find all the issues that are blocked by issues with status "To Do" we could use:


Code Block
titleJQL
key in silJQLExpression('size(linkedIssues(key, "Blocks", 1)) != 0', 'project = TEST')  and status = 'To Do'

If we want to search for the linked issues whatever the link type with resolution "Done" :

Code Block
titleJQL
key in silJQLExpression('size(linkedIssues(key)) != 0', 'project = TEST') and resolution = Done

...

Issues with subtasks

To find all issues with subtasks, we need to write this simple JQL:

...

Code Block
titleJQL
key in silJQLList("parentsOf.sil", TEST, Done, 'To Do')

...


Subtasks of issues

To search for the subtasks of issues we need to create a SIL script:

...

Code Block
titleJQL
key in silJQLList("subtasksOf.sil", TEST, Done, 'To Do')

...

Issues by comparing dates

To search for issues that were resolved after the due date:

Code Block
titleJQL
key in silJQLExpression('resolution > dueDate', 'project = TEST') 

To find issues that were updated within one week after being created:

Code Block
titleJQL
key in silJQLExpression('updated < created + "1w" ' , 'project = TEST')

...