Rest API Issue in convert macro from server to cloud

there is an issue with the Convert macro through Rest API.

in the result of GET content, there are some Null fields

  "version": { "number": 6 },
  "title": "page with macro",
  "type": "page",
  "body": {
    "view": null,
    "export_view": null,
    "styled_view": null,
    "storage": {
      "value": "<p><br /></p><p>new macro&nbsp;<br /><br /><ac:structured-macro ac:name=\"sr-choose-label-macro\" ac:schema-version=\"1\" ac:macro-id=\"ad9890dc-735d-46a8-8e0f-2282f284db3b\"><ac:parameter ac:name=\"title\">newone</ac:parameter><ac:parameter ac:name=\"descriptions\">test cloud side</ac:parameter><ac:parameter ac:name=\"button\">new</ac:parameter><ac:parameter ac:name=\"labels\">macro</ac:parameter></ac:structured-macro></p><p><br /></p>",
      "representation": "storage"
    "wiki": null,
    "editor": null,
    "editor2": null,
    "anonymous_export_view": null,
    "atlas_doc_format": null,
    "dynamic": null

so when I call update content it returns this error:

   "message":"com.fasterxml.jackson.databind.JsonMappingException: (was java.lang.NullPointerException) (through reference chain: com.atlassian.confluence.api.model.content.Content[\"body\"]->$NullIgnoringMap[\"view\"])"

Hey there @NiloufarVafaei, a recent change was made to fix this NullPointerException with explicit null fields. It rolled out to production at ~9pm EST Feb. 17th. Would you be able to try this again?

1 Like

I checked that and it’s working. TY!

1 Like