Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to use expanded fields for search with jira-rest-java-client-core?

Christian Lipp July 10, 2016

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

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Petar Petrov (Appfire)
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.
July 11, 2016

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...

Christian Lipp July 12, 2016

How would I file a feature request?

Petar Petrov (Appfire)
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.
July 12, 2016

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.

auriga_sergeykarpushin July 3, 2019

I've created a pull request for that

Like Dragana Volas likes this
0 votes
Diego Balbi September 27, 2018

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

auriga_sergeykarpushin July 3, 2019

9 months later still not there. I've created pull request for that. 

Like Dragana Volas likes this
TAGS
AUG Leaders

Atlassian Community Events