How to retrieve history details of an issue from jira using "jira-rest-java-client"?

I am not able to retrieve history details of an issue using jira rest api.

How I can retrieve history details ?

2 answers

1 accepted

0 votes
Accepted answer

You can ignore my question. I figured it out :)

getIssueClient().getIssue(bi.getKey(),Arrays.asList(IssueRestClient.Expandos.CHANGELOG));

How does this work? The second argument is ProgressMonitor progressMonitor not an array list.

FOUNT OUT!. getIssueClient().getIssue(bi.getKey(),Arrays.asList(IssueRestClient.Expandos.CHANGELOG), null);

As what kind of type of object/List am I suppose to "save" the data from the history?

 

I am getting a suggestion of:

Promise<Issue> issueHistory=  restClient.getIssueClient().getIssue(issue.getKey(),Arrays.asList(IssueRestClient.Expandos.CHANGELOG));

when I am in debugging mode and analyzing the variable "isseHistory" i cannt find any useful information.

Found it!! :)))

 

It is of type Issue ->>

Issue issueHistory =  restClient.getIssueClient().getIssue(issue.getKey(),Arrays.asList(IssueRestClient.Expandos.CHANGELOG)).claim();

try

<jira_host>/rest/api/2/issue/<ISSUE-KEY>?expand=changelog

I am new to this. i want to retrieve history details using java rest api.

how can I retrieve history details using java rest api.?

You have posted the question again as comment. Faysal's comment was the answer for your question. Read the REST API docs at https://jira.atlassian.com/plugins/servlet/restbrowser#/, search google for how to make REST calls using you language of programming.

For history as Faysal says, pass the extra argument expand=changelog.

Also search this forum for many post on the same topic, for example https://answers.atlassian.com/questions/64708/is-it-possible-to-get-the-issue-history-using-the-rest-api

I believe what nipun was specifically asking was if/how he can do this using the JIRA REST Java Client Library. Is this possible?

Yes, this is what he wanted to know. He didn't post the question as comment, he tried to clarify since the answer has nothing to do with his question.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,037 views 4 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you