Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

ScriptRunner Enhanced search with Jira Automation

Matt Noe
Contributor
July 6, 2023

Hi,

I have a case where we hoped to update issues where at least one of the linked bugs is in a 'Ready for Test' status (linked type doesn't matter but tends to be "blocked by"). Ideally, Jira automation would be best/easiest, but I am also open to using a scheduled script using Scriptrunner.

So far, I've found the issues I want to update using a query, but since I need a subquery to do that, I've only been able to use Scriptrunner Enhanced Search.

The query that I'm using is:

project = omtest and type = "Test case" AND "CORE Case?[Checkboxes]" is EMPTY AND issueFunction in linkedIssuesOf("project = "OM Testing" and type = Bug and status = "Ready for Test" ")

Goal:

Using the query above to identify the issues, I want to bulk update custom fields, and then change the status of the issue(s).  

Problem:

Jira Automation and ScriptRunner console do not allow for the Enhanced Search issueFunction and cannot handle the subquery natively (maybe the console can, but unaware of how to best proceed).

I have looked at similar issues in the community (First article, second article ), but have not found a valid answer for my case, or provided links are now dead.

2 answers

1 accepted

1 vote
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 6, 2023

Hello @Matt Noe 

Instead of using the actual JQL of the Scriptrunner filter have you tried saving that filter and then using this in the JQL field in the Automation Rule?

filter = "<name of saved Scriptrunner filter>"

3 votes
Kristian Walker _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 7, 2023

Hi Matt,

I can confirm that the enhanced JQL functions can only be run on the enhanced search page and not in native JQL due to how the JQL functions are run.

However, this does not mean you cannot use the query in other functions, as when you save and share the enhanced search filter, a regular Jira filter is created where we sync the list of issue keys returned by the enhanced search filter to the regular jira filter.

This means you can reference the Jira filter anywhere where you have native JQL using the JQL query of filter = "<name of saved filter>" as Trudy has mentioned above. 

This will allow you to use the results of the enhanced search filter inside a Jira automation or the script console to run the actions you need to run.

Regards,

Kristian

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events