Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to create a confluence page from Jira Cloud using Scriptrunner Edited

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?

2 answers

1 accepted

0 votes
Answer accepted

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

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

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

@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? 

PFA The error I am facingScreenshot 2021-01-25 at 12.22.17 PM.png

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

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
Community showcase
Posted in Jira Software

Presenting the "Best of 2020" Jira Software roundup!

Catch up with Atlassian Product Managers in our 2020 Demo Den round-up! From Advanced Roadmaps to Code in Jira to Next-Gen Workflows, check out the videos below to help up-level your work in the new ...

7,120 views 8 28
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you