Skip to main content

Job.GetJobsByBotIdAsync

Description

The API gets the list of all jobs with specified Smart Buddy Id from the connected Control Room.

C#

Task<List<ViewJobInfo>> GetJobsByBotIdAsync(int botId)

Properties

Input

PropertyDescription
botIdSpecify the SmartBuddy Id for which list of jobs information has to be retrieved.

Output

PropertyDescription
Task<List<ViewJobInfo>>Returns all Smart Buddy jobs information from the Control Room.

Remarks

Use GetJobsByBotIdAsync API to get information about all the jobs submitted by a SmartBuddy.

Example

C#
public void GetJobsBySmartBuddyId()
{
IControlRoomContext context = LoginControlRoom("RegularBuild", "BasicAuth");

int buddyId = 1;

List<ViewJobInfo> buddiesInfo = Task.Run(() => context.Jobs.GetJobsByBotIdAsync(buddyId)).Result;

foreach (ViewJobInfo buddyInfo in buddiesInfo)
Console.WriteLine("Bot Name: " + buddyInfo.BotName);
}
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;
}