Hello,
I am using jira-rest-java-client-core in version 4.0.0
I know how to retrieve expanded fields with IssueRestClient, but I am using the SearchRestClient. The interface doesn't allow to specify expanded fields:
Promise<SearchResult> searchJql(
@Nullable String jql,
@Nullable Integer maxResults,
@Nullable Integer startAt,
@Nullable Set<String> fields);
Can someone explain to me how to specify expanded fields (I am looking for the changelog items). I already tried to include it in the fields set (IssueRestClient.Expandos.CHANGELOG) but this didn't work.
In my opinion the values for the expandos are hard coded in AsynchronousSearchRestClient:
final Iterable<String> expandosValues = Iterables.transform(
ImmutableList.of(SCHEMA, NAMES), EXPANDO_TO_PARAM);
It is impossible to call the proper GET directly, since searchJqlImplGet (which allows to specify expandos) is private. I know that I could load the changelog via the IssueRestClient, but then I would need n extra calls (where n is the count of issues in the search result).
Thanks in advance, Christian
Community moderators have prevented the ability to post new answers.
You are correct - the expandos are hardcoded and cannot be changed via API calls. You could do some hacking and invoke the private method via reflection...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can open a bug here: https://ecosystem.atlassian.net/projects/JRJC/issues. The code is open source so if you feel like it, you can contribute here: https://bitbucket.org/atlassian/jira-rest-java-client.
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.
So, 2 years later, the only way to get changelog for an Issue is:
Promise<Issue> issue = getIssueRestClient().getIssue(key, Collections.singletonList(IssueRestClient.Expandos.CHANGELOG));
return issue.claim();
Isn't it?
Thanks, regards
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.