Versions Compared

Key

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


On this page:

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.


Find issues with comments

...

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

Find 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;

This script would return issues that were last updated by users that belongs to the given group.

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

Find 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:


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

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')