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
It can be done with JIRA 5 REST API using expansion like this:
/jira/rest/api/2/issue/DRW-124?expand=changelog
There doesn't appear to be on their REST documentation - http://docs.atlassian.com/jira/REST/latest/#resources
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.
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<Expandos> expand = Arrays.asList(expandArr); final Issue isssue = issueClient.getIssue("IssueID", expand, pm); Iterable<ChangelogGroup> changeLogGroupList = issue.getChangelog(); for (ChangelogGroup changelogGroup : changeLogGroupList) { System.out.println("Outputting the changelog group created by '" + changelogGroup.getAuthor() + "' at '" + changelogGroup.getCreated() + "'"); Iterable<ChangelogItem> 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() + "'"); } }
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....
this return maximum 100 results. is there any way to override this value to get more results?
@Saurabh Garg Yes. Add at the end of the url "&maxResults = <number of results you need>"
Hi,
There is any date as a query parameter through which we can get change logs before and after the date?
thanks
Of course there should be... But I cannot find any...
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
It looks like you're new here. Sign in or register to get started.