It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Job Scheduler: instead of calculating with linked Issues, using a JQL to get an array of Issues

in the template  "Calculate Progress" an array of relevant Issues is created by analyzing the Link of the current Issue.

Instead of using the Link-Types I have to use a JQL. Will this be possible and can someone prepare me an example?
My example of the JQL in a few words: all Issues of Type Story and where I am Assignee, in the same Project as the current Issue).

 

Additonal Information:

This Groovy is running well, but it is a Groovy and not an Bean Shell:

import com.atlassian.jira.component.ComponentAccessor

import com.atlassian.jira.bc.issue.search.SearchService 

import com.atlassian.jira.jql.parser.JqlQueryParser

import com.atlassian.jira.web.bean.PagerFilter

import com.atlassian.jira.issue.search.SearchQuery

def user = ComponentAccessor.jiraAuthenticationContext.loggedInUser

def jqlQueryParser = ComponentAccessor.getComponent(JqlQueryParser)

def searchService = ComponentAccessor.getComponent(SearchService)

def jqlSearch = "project=HOINTAA AND issuetype=Story"

def query = jqlQueryParser.parseQuery(jqlSearch)

//note different order of parameters compared to searchprovider

def results = searchService .search(user,query, PagerFilter.getUnlimitedFilter())

results.getResults()

return results.getResults().issuekey

 

How to modify the Groovy that it runs as Scheduled Script with Bean Shell in WBS-Featrure Settings?

 

1 answer

Even this modified Script, did throw an error:

import com.atlassian.jira.component.ComponentAccessor;

import com.atlassian.jira.bc.issue.search.SearchService; 

import com.atlassian.jira.jql.parser.JqlQueryParser;

import com.atlassian.jira.web.bean.PagerFilter;

import com.atlassian.jira.issue.search.SearchQuery;

user = "reiffm" //ComponentAccessor.jiraAuthenticationContext.loggedInUser;

JqlQueryParser jqlQueryParser = ComponentAccessor.getComponent();

SearchService searchService = ComponentAccessor.getComponent();

jqlSearch = "project=HOINTAA AND issuetype=Story";

query = jqlQueryParser.parseQuery(jqlSearch);

//note different order of parameters compared to searchprovider;

def results = searchService .search(user,query, PagerFilter.getUnlimitedFilter());

results.getResults();

return results.getResults();

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you