Skip to main content
Version: Current

TaskServices.FetchAllTasksAsync

Description

The API gets the list of all available Tasks from the connected AI Command Center.

Signature [C#]

Task<CRTasks> FetchAllTasksAsync(TaskQueryOptions taskQueryOptions)

Properties

Input

PropertyDescription
taskQueryOptionsRepresents the options used to query and retrieve task information.

Output

PropertyDescription
Task<CRTasks>Returns all available tasks information from the AI Command Center.

Remarks

Use FetchAllTasksAsync API to get the all available list of tasks information from the connected AI Command Center.

Example

C#
public void GetAllTasks()
{
IControlRoomContext context = LoginControlRoom("RegularBuild", "BasicAuth");
var filter = new ArrayList
{
new ArrayList { "status", "=", "Completed" },
"or",
new ArrayList { "status", "=", "Assigned" }
};

var sort = new[] { new Sorting { Selector = "taskId", Desc = true } };

var taskQueryOptions = new TaskQueryOptions {
Skip = 0,
Take = 1000,
Filter = filter,
Sort = sort,
RequireTotalCount = true,
IsInOutArgsRequired = true
};

CRTasks cRTasks = Task.Run(() => context.Tasks.GetAllTasksAsync(taskQueryOptions)).Result;
foreach (CRTaskInfo taskData in cRTasks.Data)
System.Console.WriteLine("Task Name: " + taskData.Name);
}
C#
public IControlRoomContext LoginControlRoom()
{
IControlRoomContext context;
string connectionString;

connectionString = "ServerUrl=https://demo.onnitellibuddies.com;UserName=demoadmin;Password=password";
context = new ControlRoomContext(connectionString);

context.Open();
return context;
}