Forums

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

Scriptrunner JQl condition to script

Olga Videc
Community Champion
January 28, 2019 edited

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
TAGS
atlassian, mindful member, mindful member badge, atlassian community, community kudos, community giveaway, atlassian swag, community values, empathy and kindness, badge challenge, atlassian learning, community engagement, swag giveaway

Earn a Badge, Win a Prize 🎁

Earning the Mindful Member badge proves you know how to lead with kindness, plus it enters you into a giveaway for exclusive Atlassian swag. Take the quiz, grab the badge, and comment on our announcement article to spread the good vibes!

Start here
AUG Leaders

Atlassian Community Events