Hi,
I am using Jira Cloud and Confluence Cloud
I found examples for creating Confluence Page from a Jira Server using ScriptRunner.
https://scriptrunner.adaptavist.com/6.17.0/jira/interacting-with-confluence-from-jira.html
But most of the libraries in the example are not available for the Cloud version. For eg `com.atlassian.applinks.api`. I am not able to use application links to authenticate Jira to Confluence. Can someone shed some light?
Hi Jibu,
I can confirm that the example you have linked to will not work as this for Jira Server and the APi's are different between the Cloud and Server versions of ScriptRunner, due to the fact Atlassian only provides a Rest API in Jira Cloud and not a Java API like the sever version contains.
This means for ScriptRunner for Jira Cloud you should always refer to its own documentation located here and sI can confirm that we have an example script located in the documentation page here which can be run from the Script Console inside of ScriptRunner for Jira Cloud.
Using this script you will be able to see how to create a Confluence page and you can use this script as a reference guide to help you to create the scripts that you require.
Regards,
Kristian
@Kristian Walker _Adaptavist_ Thanks for pointing that out.
However I see you need Scriptrunner for Confluence is also needed for this to work which is not true in my case. Can we not use AppLinks to authenticate Jira Cloud and Confluence and avoid incorporating credentials in the script?
I know it works for Jira Server and Confluence Server as mentioned here using the ApplicationLink API
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jibu,
Thank you for your response.
I can confirm if you do not have both plugins installed then as the page says then you can specify the full URL to your instance in the Rest API call and you can include authorisation to authenticate with Confluence as the API's are different between cloud and server so you cannot use APP links as you can do on Server.
I can confirm for authorisation you need to use a token as mentioned in the Atlassian API docs located here which explains how to get an API token.
Also, I can confirm the example located here which shows how to specify an API token for authorisation when making an API call as part of the header of the rest call.
Regards,
Kristian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Good day
I was able to create a page with a "Wiki" storage type. But I was not able to link back to the Jira issue on the page. How can this be done with Rest API?
In "Storage" type work:
https://domain.atlassian.net/browse/JIRA-1
But "Description" did not save "Wiki" markup.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your question.
I can confirm that to link to a Confluence page from ScriptRunner for Jira Cloud that your script would need to make a rest call to the Create or update remote issue link API which Atlassian provide and is documented here.
I can confirm we have an example of how to call this endpoint inside of the ScriptRunner for Jira Cloud documentation page located here which shows an example of how to add a link to an external URL.
I can confirm that you will be able to take this example and to use it as a reference guide and to modify it by updating it to set the globalId value which would refer to the page in Confluence as the API documentation page linked to above mentions.
Please note that we are unable to provide you with an exact script to achieve this requirement as our SLA does not cover custom coding but you can use the examples provided as a reference to create the script that you require, and we would advise asking a question on the Atlassian Community located here if you require assistance with coding the script.
I hope this helps.
Kind regards,
Kate
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Kate Kabir What I am trying to achieve here is to create a confluence page from Jira Scripttunner. The example here does not work for Jira Cloud. Can you point me the cloud version of the same example?
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.
Hi Jibu.
The link that you have provided is for Jira Server. This will not work in the Jira Cloud environment/integration. The information that I have provided earlier is for you to link to a Confluence page from ScriptRunner for Jira Cloud environment. The link that I have provided is specific to Jira Cloud integration.
The only way to achieve this, you will need to make a rest call to the Create or update remote issue link API which Atlassian provides and is documented here.
I can confirm we have an example of how to call this endpoint inside of the ScriptRunner for Jira Cloud documentation page located here which shows an example of how to add a link to an external URL.
I can confirm that you will be able to take this example and to use it as a reference guide and to modify it by updating it to set the globalId value which would refer to the page in Confluence as the API documentation page linked to the above mentions.
Thank you.
Kind Regards
Kate
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.