Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,296,024
Community Members
 
Community Events
165
Community Groups

Can you automatically resolve the affected components of a scheduled maintenace via the API?

Edited
Jon H I'm New Here Apr 25, 2022

Hi there,

When you create a scheduled maintenance via the Status Page UI, you have these automation options made available to you, notably the "set affected components' status to 'Under Maintenance'" and "set affected components' status to 'Operational" at the start time and end time of scheduled maintenances, respectively.

SP params.png

I'd like to enable these through the API, but it doesn't seem possible. I see that there are two `scheduled_auto_in_progress` and `scheduled_auto_completed` params you can pass when creating/updating an incident, but this doesn't change any of the components' statuses.

It seems that the affected components are set to `under_maintenance` immediately after you create the scheduled maintenance, even if the start time is far into the future. Additionally, these are not resolved after the scheduled maintenance is complete.

Is there a workaround for this, or perhaps something that I'm missing? Thank you!

Edit: I see now that there is a `auto_transition_to_maintenance_state` and a `auto_transition_to_operational_state` parameter that can be passed  when creating an incident. This seems to do what it suggests, but the component is still set to `under_maintenance` as soon as the scheduled maintenance is added, even if it is scheduled out weeks in advance. Is there a way to ensure that the component is only set to `under_maintenance` at the scheduled start time? The UI manages do this without issue.

1 answer

1 accepted

1 vote
Answer accepted
Scot Wilson Atlassian Team Apr 26, 2022

G'day Jon!
I'm Scot from the APAC Statuspage Support Team.

Could you check your JSON payload to see if you are setting "components" instead of "component_ids" ?

If you are use "components" - you will be setting the status of those components when you create the schedule for the maintenance, as you need to supply a component status with each component. You would normally set these values when you are creating an incident with components in different statuses.

"components": {
"q43sx76mp7wj": "under_maintenance"
}

For a scheduled maintenance - you should just supply component_ids as that is the list of component_ids that will be affected by this maintenance, and the system will change the status for these components when the maintenance starts and ends.

"component_ids": [
"dndwh3z7qsjb"
]


This is an example of the JSON needed to create a scheduled maintenance that include the component with the ids of "change_me" and "also_me".

{
    "incident": {
        "name"
:"Maintenance Scheduled for Later",
        "status": "scheduled",
        "impact_override": "maintenance",
        "scheduled_for": "2022-04-28T03:55:00.007Z",
        "scheduled_until": "2022-04-28T04:00:00.007Z",
        "scheduled_remind_prior": false,
        "scheduled_auto_in_progress": true,
        "scheduled_auto_completed": true,
        "metadata": { },
        "deliver_notifications": true,
        "auto_transition_deliver_notifications_at_end": true,
        "auto_transition_deliver_notifications_at_start": true,
        "auto_transition_to_maintenance_state": true,
        "auto_transition_to_operational_state": true,
        "body": "We are reticulating splines",
        "component_ids": [
                "change_me", "also_me"
        ]
    }
}

Hope that helps,
Scot.

Jon H I'm New Here Apr 27, 2022

Thank you so much, this is a huge help! I was definitely providing them as a `components` object rather than a `components_ids` list. I'll play around with this now, but it seems to do exactly what I was hoping for. Thanks again!

Like Cuong Trinh likes this

Suggest an answer

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

New feature: Slack notifications for Statuspage

We're excited to announce the release of a long-requested feature on Statuspage. Now visitors to your status page can subscribe to get notified in Slack when you report an incident or maintenance. Th...

3,056 views 8 20
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