Can we modify confluence content on a JIRA workflow post-function?

Hi,

I have a workflow state called RELEASED, when the transition happens to this state , can I modify content in wiki ? What I would like to do is, when RELEASE happens I want to move a certain existing page under a hierarchy to another hierarchy (like a move operation) . Is this possible ?

Sure it’s technically possible. Moving a page can be handled by the API. You’d have to fire a request via the API to move the page in question. Do you have a post-function that you need help with?

Should the post function be an event listener plugin or it can be run via a groovy script to make this change ? I’m guessing we need to use a REST API to achieve this .

Yes, you would use a REST call via app links. I’d have the post function dispatch a custom event and have your event listener perform the REST call. Might even write the endpoint on the confluence side as well. Not sure if a move exists already, but I like to have traceability on both sides.

I am using a REST API to get some details from the confluence server but it fails, I’ve posted the code here

I’d appreciate if you can have a look and correct my mistake in the code.

Thanks in advance

There’s an example of creating a page from a transition here: https://scriptrunner.adaptavist.com/latest/jira/interacting-with-confluence-from-jira.html

Moving a page is similar, just a different rest call. The key thing is to have your app links set up.

1 Like

Thanks that works. I posted the code in another question and they directed me to the same link :blush: