Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Create Inline commands in Confluence

Daniel Klein
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
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
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
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
atlassian, likes for trees, atlassian community, social impact, tree planting campaign, community kudos, atlassian giving, environmental impact, sustainability, likes for good, atlassian social responsibility, community challenge

Make every click count—help us plant 50,000 trees! 🌳

Want to make your everyday Community actions directly contribute to reforestation? The Atlassian Community can achieve this goal by liking a post, attending an ACE, sending your peers kudos, and so much more!

Help us plant more trees
AUG Leaders

Atlassian Community Events