How to get issues changelog with Jira Java Client

Tasho Georgiev February 1, 2022

When making a simple HTTP request, adding the query parameter 'expand=changelog' adds the changelog info to each issue:

https://atlassian.net/rest/api/3/search?jql=updated>-1d&expand=changelog

but I can't find a way to make a call for the changelogs from the Jira Java client, which calls this method:

public Promise<SearchResult> searchJql(@Nullable String jql, @Nullable Integer maxResults, @Nullable Integer startAt, @Nullable Set<String> fields)

I read this question https://community.atlassian.com/t5/Answers-Developer-Questions/How-to-use-expanded-fields-for-search-with-jira-rest-java-client/qaq-p/532535 but I want avoid forking the original client.

So how can I get issues changelog data? 

1 answer

0 votes
Andreas Malerz April 4, 2024

We had a similar issue and found out that with JAVA API JQL responses will never contain the changelog. An easy solution was to collect all issues via JQL and afterwards read all issues again with:

restClient.getIssueClient().getIssue( issueKey, List.of( IssueRestClient.Expandos.CHANGELOG ) );

That worked for us.

Keep in mind, that this will generate some traffic on your server as you send n+1 requests with n is the number of found issues.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events