Issue history through REST API

Mark Kofman June 16, 2011

Hey,

Is it possible to get history of issue changes using REST API? If not, is there a plan to implement that in near-term future?

thanx,

Mark

7 answers

1 accepted

11 votes
Answer accepted
Julien Hoarau
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.
June 8, 2012

It can be done with JIRA 5 REST API using expansion like this:

/jira/rest/api/2/issue/DRW-124?expand=changelog

Saurabh Garg July 26, 2017

this return maximum 100 results. is there any way to override this value to get more results?

Arunjith A October 22, 2017

@Saurabh Garg Yes. Add at the end of the url "&maxResults = <number of results you need>"

faris khan April 26, 2019

Hi,

There is any date as a query parameter through which we can get change logs before and after the date?

thanks

5 votes
Iurii Volchyn February 25, 2013

From API prospective the history is called changelog (it's one of the expandos)

Here is the example of getting changelog of an issue using JIRA Rest Java Client (JRJC)


Expandos[] expandArr = new Expandos[] { Expandos.CHANGELOG };
List&lt;Expandos&gt; expand = Arrays.asList(expandArr);

final Issue isssue = issueClient.getIssue("IssueID", expand, pm);

Iterable&lt;ChangelogGroup&gt; changeLogGroupList = issue.getChangelog();
for (ChangelogGroup changelogGroup : changeLogGroupList) {
    System.out.println("Outputting the changelog group created by '"
                    + changelogGroup.getAuthor() + "' at '"
                    + changelogGroup.getCreated() + "'");
    Iterable&lt;ChangelogItem&gt; changelogItems = changelogGroup.getItems();
    for (ChangelogItem changelogItem : changelogItems) {
        System.out.println("Changing the field '"
                        + changelogItem.getField() + "' of type '"
                        + changelogItem.getFieldType() + "' from value '"
                        + changelogItem.getFrom() + "' and string '"
                        + changelogItem.getFromString() + "' to value '"
                        + changelogItem.getTo() + "' and string '"
                        + changelogItem.getToString() + "'");
    }
}

0 votes
Jens Kisters //SeibertSolutions
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.
November 2, 2020

Im facing a similar challenge right now.

My approach:

Convert the change log to a file (e.g. PDF/A using Script Runner and Xporter).

During this conversion process i do the editing i want (e.g. leave out changes)

I store the file as an attachment and clear the history.

This way i still have the version of that changelog that i need as a file

0 votes
Ladislav Prchal July 15, 2020

Of course there should be... But I cannot find any...

0 votes
Pablo Beltran
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.
June 24, 2015

Well, another workaround if you like SQL more than REST then you might want to fetch such data via JDBC (over http, of course) and put them just right inside your favorite reporting tool (like Birt, or your custom java program) without effort. The benefits are clear when you need work with the data output. Any drawback? The SQL for JIRA plugin is not free.... 

0 votes
Renjith Pillai
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 23, 2011

A workaround which is followed is that, identify which are the specific history actions you are interested in, (for example date in which the issue moved from one state to another), create custom fields and update them during transistion using postfunctions. And custom fields are available via SOAP.

0 votes
Colin Goudie
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.
June 16, 2011

There doesn't appear to be on their REST documentation - http://docs.atlassian.com/jira/REST/latest/#resources

Suggest an answer

Log in or Sign up to answer