Scriptrunner JQl condition to script

Olga Videc
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 28, 2019

Hello, 

This is a ScriptRunner JQL

How to write this like a scripted condition, I need to add multiple fast track post functions and I need this as a condition

OR is there another way to add JQL conditions to fast-track post function

issueFunction in subtasksOf("\"Epic Link\"!=empty") 

 

1 answer

1 accepted

0 votes
Answer accepted
fjodors
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 29, 2019

Hi Olga

If you are trying to execute any code based on JQL result, you can use something like this:

 

...
//for JQL requests
def jqlQueryParser = ComponentAccessor.getComponent(JqlQueryParser)
def searchProvider = ComponentAccessor.getComponent(SearchProvider)
def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
SearchRequestManager srm = ComponentAccessor.getComponent(SearchRequestManager.class);

def jqlS = "<your JQL>";
def query = jqlQueryParser.parseQuery(jqlS);
def resultIssues = searchProvider.search(query, user, PagerFilter.getUnlimitedFilter())
def issList=resultIssues.getIssues();

if(issList.size()!=0){
    //do something
}
else{
    //do something
}

...

Suggest an answer

Log in or Sign up to answer