Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

REST API - Disabled and enabled Tasks in all stages

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.

3 answers

1 accepted

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

@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

task_disabled.PNG 

 

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.

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?

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bamboo

Bamboo Data Center is here!

G’day Bamboo customers, The wait is over! Bamboo Data Center edition you have been asking for is finally here! This self-managed enterprise offering of Bamboo has the resilience, reliability, and s...

508 views 1 17
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you