Create Inline commands in Confluence

Daniel Klein February 4, 2022

Hi all,

I try to transfer some confluence spaces from one instance to another via Rest API in a python script.
With this I try to transfer the inline commands and could not found any current API documentation for that topic.

I found an old question:

https://community.atlassian.com/t5/Answers-Developer-Questions/How-do-we-add-an-in-line-comment-to-Confluence-content-using-the/qaq-p/493729

In this post is described to set the properties:

  • numMatches
  • matchIndex
  • serializedHighlights

But if I check the original JSON from my source comment, I could not found this properties. There is only a property "markerRef".

Have anyone any hints for this problem or a current API doc?

Regards
Daniel

 

1 answer

0 votes
Daniel Klein February 4, 2022

Here is my code snippet:

 

        body_dict = {
            "type": comment['type'],
            "mode": "create",
            "container":
            {
                "id": page_id,
                "type": comment['container']['type'],
                "status": comment['container']['status']      
            },
            "body": {
                "storage": {
                    "value": comment['body']['storage']['value'],
                    "representation": comment['body']['storage']['representation']
                }
            },
            "extensions": {      
                "location": comment['extensions']['location'],
                "inlineProperties": {
                    #"numMatches": 1,
                    "originalSelection": comment['extensions']['inlineProperties']['originalSelection'],
                    "lastFetchTime":"1487711412"
                    #"matchIndex": 0,
                    #"markerRef": comment['extensions']['inlineProperties']['markerRef'],
                    #"serializedHighlights" : "[[\"Hello From me\"]]"
                }              
            }
        }
       

        body = json.dumps(body_dict)
Fuwang Chen October 24, 2022

Daniel Klein Did you find the answer for your question? I am running into 405 making the similar call ?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events