Hi,
Can't seem to find any examples/info about this. I have a JIRA gadget which takes a project ID (example: "project-1000") which comes from a dropdown box and then creates a certain graph of issues for that project.
I did this by writing a REST service (I think that's what it's called) in Java which uses ComponentManager.getIssueManager().getIssueIdsForProject().
However now I need to add the ability to choose a filter instead of a whole project. I've gotten as far as getting the filter id (ex: "filter-10000") to the Java backend service but I can't find a method which will do something similar to getIssueIdsForProject() for a filter id.
Anyone know how I'd go about this?
Thanks in advance.
Carl
Community moderators have prevented the ability to post new answers.
Use SearchRequestService to get the SearchRequest.
After you do that, try the following:
List<Issue> issues = searchService.search(user, searchRequest.getQuery(), PagerFilter.getUnlimitedFilter());
Hey Jobin, this looks like the right way to go except I'm not sure how to use getFilter. I'm trying something along the lines of this at the moment:
SearchRequest sr = SearchRequestService.getFilter(null, filterId);
But I know this is wrong. getFilter isn't static. Could you possibly give me some example code?
Thanks.
EDIT: I've gotten it to this:
SearchRequest sr = ??.getFilter(new JiraServiceContextImpl(user), filterId);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use ComponentManager.getSearchRequestService().getFilter....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
or inject it in the constructor as you do with other manager classes!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Okay I think I almost have it. Do you have any idea why the following lines would cause the plugin to not get compiled/deployed with atlas-cli?
SearchRequest sr = cm.getSearchRequestService().getFilter(new JiraServiceContextImpl(user), filterId); SearchService ss = cm.getSearchService(); PagerFilter filter = PagerFilter.getUnlimitedFilter(); com.atlassian.query.Query filterQuery = sr.getQuery(); SearchResults results = ss.search(user, filterQuery, filter); List<Issue> issues = results.getIssues();
As you can see I've broken it up all into individual lines, this was to try find the culprit. Turns out it's this line:
SearchResults results = ss.search(user, filterQuery, filter);
Any idea why?
Thank you again and sorry for being so helpless!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Was missing a try/catch around that one line! Stupid! Thank you for all your help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just use:
https://yourdomain.jira.com/rest/api/latest/search?jql=assignee was erik
or something similar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think this would only fetch the results on the Javascript side? I need to get them into Java to do some work on them first. Thanks though
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, this is the REST endpoint for it. How you use it is language dependant.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.