Comparison with ScriptRunner for Jira Server
Although you may be familiar with advanced queries in the Jira Server version of ScriptRunner, the Cloud infrastructure differs and, therefore, some queries are not available or are implemented differently. Even if you have a good understanding of JQL Functions from Jira Server, it's worth noting that some of the concepts here are a little different.
As it is not possible to integrate directly into the standard search functionality that Jira Cloud provides, the ScriptRunner Enhanced Search functionality provides the ability to run advanced JQL functions in your Jira filters in a similar way to ScriptRunner for Jira Server. You can read more details on the differences in the JQL Query Comparison information below.
It is not possible in Jira Cloud for an add-on to alter the results of a JQL search either during or after a search is being performed.
Differences
If you want to use a custom field, you can use either field key customfield_10500 or field name e.g. 'StoryPoints'. Custom field names are likely to have spaces, which can’t be parsed. If so, remove the spaces. It’s not case-sensitive but use camel-case for maximum readability. If your field names have any other punctuation you must use the format customfield_10500.
When you specify regular expressions, you don’t have to escape backslash characters. Example: write \d+ instead of \\d+
Unsupported Functions
Compared to ScriptRunner for Jira Server, we cannot deliver the functions described below.
myProjects/recentProjects
We are not able to support queries that are based on user-specific data.
aggregateExpression
At this time we are not implementing this function.
JQL Query Comparison with ScriptRunner for Jira Server
The table below contains equivalent JQL queries from ScriptRunner for Jira Server and Jira Cloud. Differences between the two systems are highlighted.
Jira Server JQL | Jira Cloud JQL | Description |
---|---|---|
issueFunction in hasComments(3) | numberOfComments = 3 | Issues have exactly 3 comments |
issueFunction in hasComments('+5') | numberOfComments > 5 | Issues have more than 5 comments |
issueFunction in hasComments('-5') | numberOfComments < 5 | Issues have less than 5 comments |
issueFunction in commented("after -7d") | lastCommentedDate > startOfDay("-7d") | Issues with comments added within the last 7 days |
issueFunction in commented("on 2012/12/31") | commentedOn = '2012-12-31' | Issues with comments created on 31st December 2012 |
issueFunction in commented("by jbloggs") | commentedBy = 5f8eddaaf162650070bce0fb | Issues with comments authored by user jbloggs via the user account ID |
issueFunction in commented('by currentUser()') | commentedBy = currentUser() | Issues with comments authored by the current logged in user |
issueFunction in commented("roleLevel Developers") | commentVisibleRole = Developers | Issues with comments restricted to the Developers role |
issueFunction in commented("groupLevel jira-administrators") | commentVisibleGroup = 'jira-administrators' | Issues with comments restricted to the jira-administrators group |
issueFunction in commented("before startOfWeek()") | firstCommentedDate < startOfWeek() | Issues with comments added before the start of this week |
issueFunction in commented('after startOfMonth(-1) before endOfMonth(-1) by currentUser()') | lastCommentedDate > startOfMonth('-1') AND lastCommentedDate < endOfMonth('-1') AND commentedBy = currentUser() | Issues with comments added after the start of last month and comments added before the end of last month and comments authored by the current user |
issueFunction in commented('inGroup jira-users') | Issues with comments by a user in the jira-users group | |
issueFunction in commented('inRole Administrators') | Issues with comments by a user with the Administrators role | |
issueFunction in lastComment('by jbloggs') | lastCommentBy = 5f8eddaaf162650070bce0fb | Issues with the most recent comment authored by user jbloggs via the user account ID |
issueFunction in lastComment('after startOfWeek()') | lastCommentedDate > startOfWeek() | Issues with the most recent comment created since the start of the week |
issueFunction in lastComment('before 2016-01-01') | lastCommentedDate < '2016-01-01' | Issues with the most recent comment created before 1st January 2016 |
issueFunction in lastComment('on 2015-02-01') | lastCommentedDate = '2015-02-01' | Issues with the most recent comment created on the 14th February 2015 |
issueFunction in lastComment('inRole Developers') | Issues with the most recent comment authored by a user with the Developers role | |
issueFunction in lastComment('inGroup jira-administrators') | Issues with the most recent comment authored by a user in the jira-administrators group | |
issueFunction in lastComment('roleLevel Developers') | lastCommentVisibleRole = Developers | Issues with the most recent comment restricted to only the Developers role |
issueFunction in lastComment('roleGroup jira-users') | lastCommentVisibleGroup = jira-users | Issues with the most recent comment restricted to only the jira-users group |
issueFunction in lastUpdated('by asmith') | Issues that were updated most recently by user asmith | |
issueFunction in lastUpdated('inRole Administrators') | Issues that were updated most recently by a user with the Administrators role | |
issueFunction in lastUpdated('inGroup jira-software-users') | Issues that were updated most recently by a user in the jira-software-users group | |
issueFunction in hasAttachments() | numberOfAttachments > 0 | Issues that have attachments |
not available | numberOfAttachments > 10 | Issues that have at least 10 attachments |
issueFunction in hasAttachments("docx") | attachmentType = "docx" | Issues that have attachments with the 'docx' file extension |
issueFunction in fileAttached('after -4w') | lastAttachmentDate > startOfDay('-4w') | Issues that have attachments uploaded since 4 weeks ago |
issueFunction in fileAttached('before lastLogin()') | firstAttachmentDate < lastLogin() | Issues that have attachments uploaded before the current users last login |
issueFunction in fileAttached('on startOfWeek()') | Issues that have attachments uploaded at the start of the week | |
issueFunction in fileAttached('by jbloggs') | fileAttachedBy = 5f8eddaaf162650070bce0fb | Issues that have attachments uploaded by user jbloggs via the user account ID |
issueFunction in workLogged('inRole Developers') | Issues that have work logged against them by a user with the Developers role | |
issueFunction in workLogged('inGroup service-desk-users') | Issues that have work logged against them by a user in the service-desk-users group | |
issueFunction in workLogged('roleLevel Developers') | worklogVisibleRole = Developers | Issues that have work logged against them restricted to the Developers role |
issueFunction in workLogged('groupLevel service-desk-users') | worklogVisibleGroup = 'service-desk-users' | Issues that have work logged against them restricted to the service-desk-users group |
issueFunction in workLogged('by jsmith') | provided by Jira: | Issues that have work logged by user jsmith via the user account ID |
issueFunction in workLogged('on 2011-06-30') | provided by Jira: | Issues that have work logged on the 30th June 2011 |
issueFunction in workLogged('after startOfWeek()') | provided by Jira: | Issues that have work logged since the start of this week |
issueFunction in workLogged('before startOfMonth()') | provided by Jira: | Issues that have work logged before the start of this month |
issueFunction in dateCompare(subquery, date comparison expression) | Both versions of ScriptRunner use JQL Functions. However, this feature has been implemented as Enhanced Search within ScriptRunner for Jira Cloud. | See JQL Functions for more information |
issueFunction in hasSubtasks() | numberOfSubtasks > 0 | Issues that have subtasks |
not available | numberOfSubtasks >= 10 | Issues that more than or equal to 10 subtasks |
issueFunction in subtasksOf(subquery) | Both versions of ScriptRunner use JQL Functions. However, this feature has been implemented as Enhanced Search within ScriptRunner for Jira Cloud. | See JQL Functions for more information |
issueFunction in parentsOf(subquery) | Both versions of ScriptRunner use JQL Functions. However, this feature has been implemented as Enhanced Search within ScriptRunner for Jira Cloud. | See JQL Functions for more information |
issueFunction in hasLinks() | numberOfLinks > 0 | Issues that have links to other issues |
not available | numberOfLinks = 5 | Issues that have 5 links to other issues |
issueFunction in hasLinks("is blocked by") | hasLinks = "is blocked by" | Issues that are blocked by other issues |
issueFunction in hasLinkType("Duplicate") | issueLinkType = "Duplicate" | Issues that have a Duplicate issue link (either inbound or outbound) |
issueFunction in linkedIssuesOf(subquery) | Both versions of ScriptRunner use JQL Functions. However, this feature has been implemented as Enhanced Search within ScriptRunner for Jira Cloud. | See JQL Functions for more information |
issueFunction in epicsOf(subquery) | Both versions of ScriptRunner use JQL Functions. However, this feature has been implemented as Enhanced Search within ScriptRunner for Jira Cloud. | Can be achieved using linkedIssuesOf |
issueFunction in issuesInEpics(subquery) | Both versions of ScriptRunner use JQL Functions. However, this feature has been implemented as Enhanced Search within ScriptRunner for Jira Cloud. | issuesInEpics that match the subquery |
issueFunction in linkedIssuesOfRecursive(subquery, linkName) | Both versions of ScriptRunner use JQL Functions. However, this feature has been implemented as Enhanced Search within ScriptRunner for Jira Cloud. | See JQL Functions for more information |
issueFunction in linkedIssuesOfRecursiveLimited(subquery, depth, linkName) | Both versions of ScriptRunner use JQL Functions. However, this feature has been implemented as Enhanced Search within ScriptRunner for Jira Cloud. | See JQL Functions for more information |
issueFunction in linkedIssuesOfRemote(remoteLink, searchTerm) | Issues with remote links that match the search term | |
issueFunction in expression(Subquery, expression) | See JQL Functions for more information | |
project in projectMatch(regularExpression) | Both versions of ScriptRunner use JQL Functions. However, this feature has been implemented as Enhanced Search within ScriptRunner for Jira Cloud. | See JQL Functions for more information |
fixVersion in versionMatch(regularExpression) | Both versions of ScriptRunner use JQL Functions. However, this feature has been implemented as Enhanced Search within ScriptRunner for Jira Cloud. | See JQL Functions for more information |
component in componentMatch(regularExpression) | Both versions of ScriptRunner use JQL Functions. However, this feature has been implemented as Enhanced Search within ScriptRunner for Jira Cloud. | See JQL Functions for more information |
issueFunction in issueFieldMatch(subquery, fieldName, regularExpression) | Both versions of ScriptRunner use JQL Functions. However, this feature has been implemented as Enhanced Search within ScriptRunner for Jira Cloud. | See JQL Functions for more information |
issueFunction in issueFieldExactMatch(subquery, fieldName, regularExpression) | Both versions of ScriptRunner use JQL Functions. However, this feature has been implemented as Enhanced Search within ScriptRunner for Jira Cloud. | See JQL Functions for more information |
issueFunction in recentProjects() | Issues in the current user’s recently view projects. See JQL Functions. | |
issueFunction in myProjects() | Issues in the current user’s projects. See JQL Functions. | |
issueFunction in aggregateExpression() | See JQL Functions for more information | |
fixVersion in earliestUnreleasedVersionByReleaseDate(projectKey) | Issues with a fixVersion that matches the unreleased version with the earliest release date | |
issueFunction in addedAfterSprintStart(boardName, sprintName) | Both versions of ScriptRunner use JQL Functions. However, this feature has been implemented as Enhanced Search within ScriptRunner for Jira Cloud. | Issues that were added to a sprint after it started. See JQL Functions. |
issueFunction in removedAfterSprintStart(boardName, sprintName) | Issues that were removed from a sprint after it started | |
issueFunction in incompleteInSprint(boardName, sprintName) | Issues that were not completed in a sprint | |
issueFunction in completeInSprint(boardName, sprintName) | Issues that were completed in a sprint | |
issueFunction in nextSprint(boardName) | Both versions of ScriptRunner use JQL Functions. However, this feature has been implemented as Enhanced Search within ScriptRunner for Jira Cloud. | Issues that are in the next sprint for a given Agile board. See JQL Functions. |
issueFunction in previousSprint(boardName) | Both versions of ScriptRunner use JQL Functions. However, this feature has been implemented as Enhanced Search within ScriptRunner for Jira Cloud. | Issues that are in the previous sprint for a given Agile board. See JQL Functions. |
issueFunction in inSprint(boardName, sprintName) | Both versions of ScriptRunner use JQL Functions. However, this feature has been implemented as Enhanced Search within ScriptRunner for Jira Cloud. | Issues that are in a given sprint. See JQL Functions. |