Hi developers!
We’ve added a new temporary field to some of the Confluence Webhooks.
What is changing?
Starting from May 1, 2022, webhooks listed below, in addition to numeric id field, also contain new idAsString field with the same id value, but in the string format. This field is temporary and is added to help with migration of the existing id field from number to string , which will happen in 6 months.
Example of a page_viewed webhook payload:
{
"userAccountId": "<truncated>",
"accountType": "customer",
"page": {
"idAsString": "153911297",
"creatorAccountId": "<truncated>",
"spaceKey": "~377712048",
"modificationDate": 1588017393390,
"lastModifierAccountId": "<truncated>",
"self": "https://<sitename>.atlassian.net/wiki/spaces/~377712048/pages/153911297/Page",
"id": 153911297,
"title": "My Page",
"creationDate": 1587664115472,
"contentType": "page",
"version": 4
},
"timestamp": 1651525425754
}
What do I need to do?
If your app is strongly typed or in any other way won’t be able to process the id field if its type is changed to string (for example if you compare it to other values using === operator in JavaScript), please temporarily migrate your app to use idAsString field instead. You’ll need to migrate back to id field after its type changes. A separate announcement will be made before deprecating idAsString (follow up ticket).
If your app is able to handle the id field irrespectively whether its type is number or string please continue to use id field.
Why we’re doing it?
The change was made to address the issue with customers migrated from Server to Cloud, for which entity ids now start with an arbitrary big number that exceeds the maximum integer number value for JavaScript - 2^53 - 1 . This issue has been fixed, so no new migrated customers will have this problem, but customers migrated before this fix was rolled out, are still affected.
Affected webhooks
The following webhooks now contain idAsString field for page, blogpost, attachment and comment entities:
attachment_archivedattachment_createdattachment_removedattachment_restoredattachment_trashedattachment_unarchivedattachment_updatedattachment_viewedblog_createdblog_removedblog_restoredblog_trashedblog_updatedblog_viewedcomment_createdcomment_removedcomment_updatedcontent_permissions_updatedlabel_addedlabel_createdlabel_deletedlabel_removedpage_archivedpage_children_reorderedpage_createdpage_copiedpage_movedpage_removedpage_restoredpage_trashedpage_unarchivedpage_updatedpage_viewedspace_createdspace_logo_updatedspace_permissions_updatedspace_removedspace_updated