Skip to content

Incorrect URI for REST call to retrieve changelog records #13

@Jura

Description

@Jura

Jira export tool fails to process issues with the following stack trace:

[l:D][d:17:05:56] Connecting to Jira...
[l:I][d:17:05:56] Connected to Jira.
[l:I][d:17:05:56] Gathering project info...
[l:I][d:17:05:57] Custom field cache set up.
[l:I][d:17:05:57] Custom parsers set up.
[l:I][d:17:05:57] Link types cache set up.
[l:I][d:17:05:57] Processing issues...
[l:D][d:17:05:57] Downloaded [issue ID]
[l:E][d:17:05:57] Unexpected error: System.AggregateException: One or more errors occurred. ---> System.InvalidOperationException: Response Status Code: 404. Response Content: {"message":"null for uri: https://[jira server]/rest/api/2/issue/[issue ID]/changelog?maxResults=100&startAt=0","status-code":404}
   at Atlassian.Jira.Remote.JiraRestClient.GetValidJsonFromResponse(IRestRequest request, IRestResponse response)
   at Atlassian.Jira.Remote.JiraRestClient.<ExecuteRequestAsync>d__10.MoveNext()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
   at JiraExport.JiraProvider.<DownloadChangelog>d__18.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at JiraExport.JiraItem.BuildRevisions(JiraItem jiraItem, JiraProvider jiraProvider)
   at JiraExport.JiraItem.CreateFromRest(String issueKey, JiraProvider jiraProvider)
   at JiraExport.JiraProvider.ProcessItem(String issueKey, HashSet`1 skipList, String successMessage)
   at JiraExport.JiraProvider.<EnumerateIssues>d__17.MoveNext()
   at JiraExport.JiraCommandLine.ExecuteMigration(CommandOption user, CommandOption password, CommandOption url, CommandOption configFile, Boolean forceFresh)

According to the documentation there is no "/changelog" endpoint and it should be referenced as https://[jira server]/rest/api/2/issue/[issue ID]?expand=changelog&maxResults=100&startAt=0 instead.

I've tested this construction and amended URI returns expected results

tested platform: Jira Server v7.12.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions