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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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,556,448
Community Members
 
Community Events
184
Community Groups

Difference between PUT and PATCH request for API /pages/{page_id}/incidents/{incident_id}

Is there any difference between PUT and PATCH requests for /pages/{page_id}/incidents/{incident_id} URL to update an incident? I see same result using any of the above,

1 answer

0 votes
DPKJ
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 11, 2020

@Sandeep_A  Welcome to the community!

There is slight difference here (https://developer.statuspage.io/#section/Basics)

 

  • PATCH - Update a single element
  • PUT - Replace a single element in a collection (rarely used)

 

This means that when you call PATCH on `Incident`, only field that you are passing as payload will be updated and rest will remain same.

With PUT, all fields will be updated (i.e. old field will be replaced), it will require to send all fields as payload.

As an example, I am trying to update a particular component associated with an incident with PATCH request as below. As a result of this request, the other components associated with this incident are removed and only the one in the request is present. Ideally, the PATCH request should have just updated the component listed in this request and leave the rest as is. Any thoughts ?

{
"incident": {
"name": "Sample incident modified",
"status": "monitoring",
"impact_override": "minor",
"body": "We are continuing to work on a fix for this issue. Monitoring",
"components": {
"2vjjt397ssd2": "operational"
},
"component_ids": [
"2vjjt397ssd2"
]
}
}

DPKJ
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 11, 2020

@Sandeep_ABy general API conventions your assumption is correct, but not all API providers are equal. So I guess for Atlassian in case of StatusPage, you need to provide full set for 'components_ids'.

But I will check with Atlassian team, if this is a design bug.

Like Sandeep_A likes this

Sure Thanks!. For now, there is no difference in the way PUT and PATCH behaves for this end-point.

Hello. I am on the exact same situation. When i try to add a new component in the components_id the previous values are replaced. 

So the only solution is to populate again the 2 arrays

components and

component_ids??

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events