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

Is it possible to get the issue history using the REST API?

Dieter Arand November 27, 2012

Is it possible to get the history of an issue using the JIRA REST API?

Hi,

I'm using the REST interface in Excel with VBA.

I know that expand=changelog should do the job, but I get the same result either with this expresson or without it.

I attached my test code and both Debug.Print deliver exactly the same result

Any idea what's wrong?

We are using Jira 4.3.3 and it looks like, that this interface is not supported for that version.

Also ?fields does not work for GET.

So any other idea how I can get the change history for an item or can get access to single fields with my version?

Many Thanks!

Dieter

Private JiraService As New MSXML2.XMLHTTP60
Private JiraAuth As New MSXML2.XMLHTTP60
Public sRestAntwort As String
 
Sub JiraAccess()
With JiraAuth
    .Open "POST", "http://JiraServer/rest/auth/1/session", False
    .setRequestHeader "Content-Type", "application/json"
    .setRequestHeader "Accept", "application/json"
    .Send " {""username"" : ""user"", ""password"" : ""passwd""}"""
    sCookie = "JSESSIONID=" & Mid(sErg, 42, 32) & "; Path=/Jira"
End With
 
With JiraService
    .Open "GET", "http://JiraServer/rest/api/2.0.alpha1/issue/JRA-444", False
    .setRequestHeader "Content-Type", "application/json"
    .setRequestHeader "Accept", "application/json"
    .setRequestHeader "Set-Cookie", sCookie
    .Send
    sRestAntwort = .responseText
    Debug.Print "*************************"
    Debug.Print .responseText
    Debug.Print "*************************"
End With
 
With JiraService
    .Open "GET", "http://JiraServer/rest/api/2.0.alpha1/issue/JRA-444?expand=changelog", False
    .setRequestHeader "Content-Type", "application/json"
    .setRequestHeader "Accept", "application/json"
    .setRequestHeader "Set-Cookie", sCookie
    .Send
    sRestAntwort = .responseText
    Debug.Print "*************************"
    Debug.Print .responseText
    Debug.Print "*************************"
End With
 
With JiraAuth
    .Open "DELETE", "http://JiraServer/rest/auth/1/session", False
    .Send
End With
End Sub

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
MattS
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, 2014

Using expand=changelog does give you the full issue history, not just the worklog. For example:

https://jira.atlassian.com/rest/api/2/issue/JRA-1234.json?expand=changelog

But it probably is not supported for JIRA 4.4 (which is way past EOL)

0 votes
Pedro Cora
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 23, 2014

From my understanding of the API documentation (https://docs.atlassian.com/jira/REST/latest/) you will only be able to get the worklog, not all the issue details calling this method.

;)

MattS
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 30, 2014

Pedro, check out the information returned from

https://jira.atlassian.com/rest/api/2/issue/JRA-1234.json?expand=changelog

under changelog, histories. That looks like the issue history tab info to me.

TAGS
AUG Leaders

Atlassian Community Events