Skip to main content

Job.GetJobStatusAsync

Description

The API gets the job status with a specified Id from the connected Control Room.

Signature [C#]

Task<string> GetJobStatusAsync(int jobId)

Properties

Input

PropertyDescription
jobIdSpecify the Id of the Job whose status has to be retrieved.

Output

PropertyDescription
Task<string>Returns the status of the job.

Remarks

Use GetJobStatusAsync API to get the status of the specified job Id from the connected Control Room.

Example

C#
public void GetJobStatus()
{
IControlRoomContext context = LoginControlRoom("RegularBuild", "BasicAuth");
int jobId = 1;

string jobStatus = Task.Run(() => context.Jobs.GetJobStatusAsync(jobId)).Result;

Console.WriteLine("Job status: " +jobStatus);
}
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;
}