Skip to content

[Confluence Cloud] create_or_update_template always returns a 400 JsonMappingException #1083

Open
@mikewyer

Description

@mikewyer

This feels like a bug in the ContentTemplate schema on the server side rather than a code bug, but it's hard to be sure.

What I do know is that trying to update an existing template via the API always fails with:

HTTPError: org.codehaus.jackson.map.JsonMappingException: Can not instantiate value of type [simple type, class 
com.atlassian.confluence.api.model.content.template.ContentTemplate] from JSON String; no single-String constructor/factory method

Example code: successfully fetching an existing template, then trying to "update" it without any changes:

template_data = wiki.confluence.get_content_template(template_id)
confluence.create_or_update_template(
            name=template_data["name"],
            body=template_data["body"],
#            body={"representation": "view", "value": "lorem ipsum"},
            template_id=template_id,
            description=template_data["description"],
            labels=template_data["labels"],
            space=template_data["space"]["key"],
        )

Metadata

Metadata

Assignees

No one assigned

    Labels

    confluenceAtlassian Confluence (Cloud, Server or Dataceneter)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions