Hi JIRA devs
I have a problem with searching jira issue from a plugin. It's about the following code:
final JqlQueryBuilder jql = JqlQueryBuilder.newBuilder();
String projectkey = "PROJECT";
long cfkey = 10300L;
String uid = "abcd1234";
Query query = where().project(projectkey).and().customField(cfkey).eq(uid).buildQuery;
SearchProvider searchProvider = COMPONENT_MANAGER.getSearchProvider();
SearchResults results = searchProvider.search(query, user, PagerFilter.getUnlimitedFilter());
So this query returns an empty result set. I tried several things. Also this
Query query = where().project(projectkey).and().customField(cfkey).notEq(uid).buildQuery();
Which should actually return all the other issue in the project.
I also tried without project, just the customfield search.
And the funny thing is, this even does not work for the fields "description" and "environment" either. The user has the rights to see these issues. Selecting just the project works like a charm:
Query query = where().project(projectkey).buildQuery();
I think, something goes really wrong here. Somebody has a guess?