Hello there,
How could I find an specific job name into a group?
I'm already getting all jobs into group but from there I don't know how 'filter' a job name.
Thanks.
Hello there,
How could I find an specific job name into a group?
I'm already getting all jobs into group but from there I don't know how 'filter' a job name.
Thanks.
I moved your post to a new topic since it doesn't seem to be a continuation of the topic where you posted it.
The simplest way to get a specific job if you already know the group name and job name is:
context.GetJob("group name\job name");
If you want to iterate through all the jobs for a group that you have already fetched, you can use something like this:
var jobs=group.GetJobs(ObjectFetchOptions.StubsOnly,false)
foreach(var job in jobs)
{
if(job.Name.Equals("target job name", StringComparison.OrdinalIgnoreCase ))
{
//that's your job
}
}
But GetJob is going to be more efficient.
Replies are disabled for this topic.