Octopus API - Get Tasks by Ids, returns more than expected items

I’m using Octopus.Client, and noticed following while fetching set of Tasks by Ids.

Code block is similar to follow (some stuff has been removed here, for simplicity),

var endpoint = new OctopusServerEndpoint("URL", "ApiKey");

var _client = await OctopusAsyncClient.Create(endpoint);

var tasks = await _client.Repository.Tasks.Get("ServerTasks-100", "ServerTasks-101");

Then I noticed, all the tasks are being loaded from the server, instead of specified two tasks.

I checked this with fiddler and related request is similar to follow:

URL/api/tasks?ids=ServerTasks-100,ServerTasks-101

For the above request there are 30 items in the response (which should be only 2).
Then there were 3 consecutive requests to load rest of the tasks.

I guess this is not the way it should work. Simply this should load only two tasks.

Or did I missed something here?

Hi,

Thanks for reaching out! We have a bug open for this with a PR pending for review: https://github.com/OctopusDeploy/Issues/issues/3622

You can follow that github issue for updates to get notified when it gets fixed. It should be pretty soon.

Thanks!
Dalmiro

Thank you Dalmiro! :slight_smile: