Using ScriptRunner Enhanced Search with Custom Charts for Jira (Cloud)
What is Scriptrunner Enhanced Search?
Due to the infrastructure of Jira Cloud, ScriptRunner functions cannot be accessed in Jira Query Language (JQL) queries in Issue Search and Jira Dashboards directly. To use ScriptRunner functions in queries, users must use ScriptRunner’s Enhanced Search feature.
Here, users create a filter with the ScriptRunner function included, then save it, allowing it to be used across Jira in projects, reports, and Dashboards. You can use your filters in any Custom Charts for Jira gadgets, including Simple Search and Issue List.
Steps to Build out Enhanced Search Filters in Scriptrunner
In the Jira header, click Apps-->ScriptRunner Enhanced Search
In Enhanced Search, begin typing in your JQL query in the search bar. You can use ScriptRunner functions in the query
If you click the + in the search bar, you can access a list of available ScriptRunner functions for your query
Once you’ve written your JQL query, click Save as Filter
In the dialog box that appears:
Name the filter
Turn the Sync Filter toggle on
Optional: If you want any user to be able to pull the filter into boards and Dashboards, turn the Share with all toggle on
Optional: If you want to restrict filter access to specific projects and/or Jira groups, select them in the Choose Projects and/or the Choose Groups drop downs
Click Save. The Enhanced Search filter will now appear in the Filters dropdown in the Jira navigation header, and will be accessible in all gadgets on Dashboards
Use Enhanced Search filter in Custom Charts gadgets
Source Dropdown
This is applicable across all of our gadgets, including Custom Charts, Issue List, and Simple Search
On the right side of the gadget, click the Source dropdown and select Saved filters
Click into the filter search bar, and begin typing in the name of your filter. Once it appears on the list, select it. This sets the Enhanced Search Filter as the gadget’s Source.
Chart By/Group By settings
This is applicable for the Custom Charts gadget only, as Issue List and Simple Search do not have these dropdowns
On the right side of the gadget in the Chart by or Group by dropdown, select Saved filters
Navigate to the Chart By tab or Group By tab on the right side of the gadget
Click into the box that says “Search for saved filters…” and select your filter. This sets the Enhanced Search Filter as the Chart by or Group by value.
Simple Search Fields
This is applicable in Simple Search only, as Issue List and Custom Charts do not have Simple Search fields
In the right side of Simple Search, navigate to the Simple Search Fields section, then click + Add saved filter toggle
Click into the saved filter dropdown and select the Enhanced Search filter from the list. This sets the Enhanced Search Filter as a Simple Search field.
Issue List Quick Filters
This is applicable in Issue List in Jira Cloud only, as Simple Search and Custom Charts do not have Quick Filters
In the right side of Issue List, navigate to the Quick Filters section, then click + Add saved filter toggle
Click into the saved filter dropdown and select the Enhanced Search filter from the list. This sets the Enhanced Search Filter as a Quick Filter.