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

How do you remove a component from a group via the components/ API?

Luke Murray
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 18, 2022

I'd like to remove a component from its group via the API. I'm trying to do this by using PATCH on the specific component's URL. Here's the cUrl I'm trying:

curl -v https://api.statuspage.io/v1/pages/$PAGE_ID/components/$COMPONENT_ID \
-H "Authorization: OAuth $STATUSPAGE_AUTH_TOKEN" \
-X PATCH \
-H "Content-Type: application/json" \
-d '{"component":{"group_id":null}}'

However, this gives the following error:

{"error":"Couldn't find GroupComponent"}

I also tried setting the `group_id` to `""` but that gave the same result. What do I actually need to do to achieve this?

I'd like to avoid using the component-groups/ API methods if possible as this way is more convenient. You can set a component's group in the UI page for that particular component so I don't see why the API should be any different.

1 answer

1 accepted

0 votes
Answer accepted
Shivam Naik
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 19, 2022

Hi @Luke Murray ,

Happy to help!

The endpoint you've shown is for components, but you will need to the component-groups endpoint shown here https://developer.statuspage.io/#operation/patchPagesPageIdComponentGroupsId in order to remove the components. This command will essentially "overwrite" the original group contents so that it will contain the components you list in the command.

Please let me know if that was what you were looking for!

Thank you,
Shivam

Luke Murray
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 21, 2022

Disappointing you can't do it that way but I can see why you can't.

Shivam Naik
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 21, 2022

That's feedback I can pass along to our Engineering team; it is a bit confusing choosing the right endpoint for this particular task, but since this is related to Groups specifically vs individual components, that former endpoint will be the one to use as a means of changing the groups themselves.

Please let us know if you have any follow up questions!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events