Forums

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

How to copy specific content in confluence wiki pages from one page to other?

Vivek Singh April 23, 2020

Hi there,

I am trying to copy rows from a table based on specific text in a column from one confluence page to other. I looked for 'Excerpt' macro option to do this task but seems like there is no option to do this based on specific text.

 

Confluence_Img.JPG

In the above table, I want to copy rows where Status column contains 'Load Complete' or row color is blue, whichever option is feasible.

Thanks for the help.

Vivek

1 answer

1 accepted

1 vote
Answer accepted
Dominic Lagger
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 25, 2020

Hi @Vivek Singh 

Do you want the content to be updated automatically from the table? 

I don't think this is possible. And sadly, I can't imagine any workaround or another solution for that. I'm sorry. 

The only thing you could do is check out this plugin:

Regards, Dominic

Vivek Singh April 27, 2020

Thank you @Dominic Lagger  for helping out.

Is it possible to achieve the above task using REST API, i haven't worked on it but I have seen it as an option on doing these operations on other forums.

Regards,

Vivek Singh

Dominic Lagger
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 27, 2020

Hi @Vivek Singh 

It would be possible, but a really bad hack (in my opinion)

First, you would have to get the page content where the table is stored. You need the GetContent funcction. 

http://example.com/confluence/rest/api/content?spaceKey=TST&title=Cheese&expand=space,body.view,version,container

Then you have to parse the content by your own. So here you have to search the table. One you get the table, you can parse, where the background-color is blue or where the state is 'Load Complete'. 

If you want to do it with an own user macro and velocity, it will be really hard work (and a lot of try and error). If you want it with python, you should be able to achive this. 

If you achieved it, let us all know :) 

Like Vivek Singh likes this
Vivek Singh April 27, 2020

Thanks @Dominic Lagger  for the quick response, really appreciate that :)

Other thing I have in mind is, how to have some validations on my confluence page? For e.g. in a particular section in the page I want to check if names have an email hyperlink or not? Is it also possible only through REST or there are other easier options available.

Regards,

Vivek Singh

Dominic Lagger
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 27, 2020

It depends how the names are recognisable? Do you need to check always just 5 names? Or all names which could appear on a page?  

What you could do is writing a user macro which do it for you. But as before, you get the page content and have to parse the page. If you can spot the names with a parser, then it's possible. 

In confluence, again, the possibility is to write a user macro. But user macros are written in "velocity". So this would be very tricky to make such a check.

Like Vivek Singh likes this
Vivek Singh April 27, 2020

Thank you @Dominic Lagger  :).

Will reach out in case of any other questions.

Like Dominic Lagger likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events