Get a conflunce page source into a JIRA custom field

Sandeep Rawat August 31, 2015

My need is to read a confluence page source and copy the same into a JIRA custom field from a JIRA transtion post function. Any ideas on how this can be achieved.

Is this possible using the groovy script runner? a sample code would help

Thanks

Sandeep

 

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
JamieA
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.
August 31, 2015

It's more or less the same as https://gist.github.com/jechlin/cf9ccb524918993872d5, but instead of "post"ing to confluence you will use the API to get the markup source.

SandeepR September 1, 2015

Thanks for the solution Jaime, I used the same code as indicated above with the following changes, this gives me the whole HTML rendered page, however i wanted to extract only the page source, what am I missing here? def authenticatedRequestFactory = confluenceLink.createAuthenticatedRequestFactory() ApplicationLinkRequest request = authenticatedRequestFactory.createRequest(Request.MethodType.GET, "URL of the confluence page "); request.addBasicAuthentication("xxx","xxx"); String xml_result = request.execute();

TAGS
AUG Leaders

Atlassian Community Events