We're building on our front page a list of tasks for each user. For this effect, we use AJAX to call the REST API:
jQuery.ajax({
url: "/rest/mywork/1/task",
type: "GET",
dataType: "json",
success: function(data){ }
While this works, it doesn't show all the user tasks, only some of them. When I print the results, not all the user tasks are shown. Is there an way I can force it to show all the tasks?
Hi @@Mariana Aires
REST API responses in Confluence server are, most of the times, paginated as highlighted in Pagination in the REST API .
You may want to play with the following REST API call, which is the same used for the Task Report that is found in the user's profile.
/rest/inlinetasks/1/my-task-report/?pageSize=5&pageIndex=0&reportParameters=%7B%22columns%22%3A%5B%22description%22%2C%22duedate%22%2C%22location%22%5D%2C%22assignees%22%3A%5B%22user001%22%5D%2C%22creators%22%3A%5Bnull%5D%2C%22status%22%3A%22incomplete%22%2C%22sortColumn%22%3A%22duedate%22%2C%22reverseSort%22%3Afalse%7D
You may change the pageSize and pageIndex values to get different results.
pageSize: how many tasks in the current page
pageIndex: which page to get, starting from 0
I hope that helps.
Kind regards,
Thiago Masutti
When I try using the call you suggested, this is the result I get
{currentPage: 0, totalPages: 0, adaptive: false, detailLines: Array(0)}
Changing the parameters doesn't fix it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I forgot to give you an additional information on that URL.
Where you read user001, change it for the target username.
That should do it.
Kind regards,
Thiago Masutti
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Thiago Masutti ,
I also need the API to read task and your solution it works for me. Thank you.
Is there any API document or introduction of this?
rest/inlinetasks/1/my-task-report/
I want to know more detail.
Thank you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.