Hi team.
I am looking for an endpoint which can help me find the disabled and enabled tasks in all the stages for a plan. Looking forward to your help. Thanks in advance.
to help other members who might eventually find their way here - as per above comment from @Richard White _TechTime_ there is no way to get task information using REST API
Hi,
You can use the plan endpoint to get this information:
/rest/api/latest/plan/<plan-key>?expand=stages.stage.plans
If you set header
Accept:"application/json`
you will get something in the following format:
{ "expand":"actions,stages,branches,variableContext", ..., "project":{ <project info like key description etc.>, "enabled":true, "stages":{ "size":4, ..., "stage":[ { ... "plans":{ "plan":[ { "key":"TEST", "type":"JOB" ...<Other plan info>, "enabled":true, }, ... <Other jobs> ] } } ] } }}
Which hopefully is the info you are looking for?
@Richard White _TechTime_ thank you for taking time to answer the query. Having looked at the above solution, it is not the one that could help me.
I will try and elaborate a bit more -
As we can see below, I have a task which is disabled
So, if I have 2 stages and 4 jobs within them and each of the jobs has - say 5 tasks.
How do I know which of the tasks in which these jobs are disabled? using the REST API?
Ah I see, I my response will only give the status for each job, not each task.
To the best of my knowledge there is no rest api which will give you task information.
It looks like you're new here. Sign in or register to get started.