Hello.
I'm building a workflow post function in a JIRA plugin and would like it to call Confluence to perform some actions. I assume the right thing to do is to use the Confluence REST API to perform the desired actions but I can't seem to find anything that explains how to do that.
I'm an experienced developer and have written a variety of JIRA plugins but have never had to write a plugin that calls outside of JIRA itself.
Is there an easy way to call Confluence (or any REST service) from inside a JIRA plugin?
Community moderators have prevented the ability to post new answers.
ah ha, I see where I went wrong. I was mixing REST and SOAP. I had a code fragment that looks as follows:
URL endpoint = new URL(confluenceURL); service = serviceLocator.getConfluenceserviceV2(); String token = service.login(confluenceUser, confluencePwd); RemoteSpace remoteSpace = new RemoteSpace(); remoteSpace.setKey(projectKey); remoteSpace.setName(projectSpaceName); remoteSpace.setDescription("Space automatically created via JIRA transition"); remoteSpace = service.addSpace(token, remoteSpace);
The tutorial is focused on REST (which is exactly what I asked for).
Am I correct to assume that REST would be a better way to go that the WebServces/SOAP API? If not, how do I use SOAP from within a JIRA plugin?
Yes, use REST if possible. All other remote APIs are deprecated. See: https://developer.atlassian.com/confdev/confluence-rest-api
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That is pretty easy if your Confluence is linked via an Application Link. There is a tutorial for pretty much exactly your use-case.
It's also possible without an Application Link, but you have to take care of authentication yourself, which unfortunately I can't help you with.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.