Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jira Rest Api Nested MaxResults (get all worklog within time period)

Tags:

.net

jira

I am writing an app that should get all the worklogs within specified time period for all jira users. I am using jira rest api to get these information, however i have a problem with nested maxResults for each issue that i get. This is the url i am using:

https://"your_jira_home"/rest/api/latest/search?jql=key in workedIssues("2014/12/8","2014/12/12","jira-users")&fields=worklog&maxResults=-1

This will return all issues (up to 1000) within specified time range for all users and their worklogs, but it will return 20 worklogs per issue, and i need more (all of them).

{ "expand": "schema,names", "startAt": 0, "maxResults": 1000, "total": 98, "issues": [{ "expand": "operations,editmeta,changelog,transitions,renderedFields", "id": "", "self": "", "key": "", "fields": { "worklog": { "startAt": 0, "maxResults": 20, "total": 1,...

Is there a way to specify nested max results (the one in "worklog")?

Another way for getting worklogs would be using this url:

https://"your_jira_home"/rest/api/latest/search?jql=project=your_project_name&fields=worklog&maxResults=-1

but the same problem occurs with nested maxResults.

I am developing app in .NET, and i am not using any plugin for jira yet.

like image 211
Petar Djordjevic Avatar asked Dec 26 '14 10:12

Petar Djordjevic


1 Answers

It is not possible to change the startAt or the maxResults of the nested worklog results in the current Jira API version 2.

To get all the worklog records of an issue you need to use: https://"your_jira_home"/rest/api/latest/issue/{issueIdOrKey}/worklog

There isn't a way to query multiple issues who have more than 20 worklog records and get all the worklog records.

https://answers.atlassian.com/questions/327748/how-do-i-set-maxresults-for-work-logs

like image 60
charlie k Avatar answered Nov 04 '22 10:11

charlie k