Hi All,
I'm trying to authenticate the confluence cloud via Jira cloud script runner post function to create a page from the post function.
Please find the attached error and here is the link to the script I tried,
https://library.adaptavist.com/entity/create-a-confluence-page-for-each-subtask-of-an-issue
TIA!
Hi Ash,
Thank you for your question.
I have reviewed the error attached in the screenshot above and can confirm that it indicates that the user who is logged into Jira Cloud when the script was not run does not have a user account in Confluence Cloud with permissions to create pages.
I can confirm that the Libray script which you are using is designed to to be run when an application link exists between Jira Cloud and Confluence Jira Cloud and should be run as the ScriptRunenr Add On User when ScriptRunner is installed in both Jira and Confluence Cloud.
In order to try and work around this error can I please ask you to try running the script as the ScriptRunner Add-on User by changing the user in the Run as box on the screen if you have ScriptRunner installed inside of both Jira and Confluence Cloud.
If you don't have the instances linked or ScriptRunner installed in Confluence Cloud, then you will need to manually specify the authentication credentials and I can confirm that the example script located here shows how to do this below the Specify credentials to access Confluence comment.
I would ask you to refactor your script if you need to specify the authentication details using the syntax shown in the example linked above.
I hope this helps.
Regards,
Kristian
Hi @Kristian Walker _Adaptavist_ ,
Thank you so much. This is working.
Can you please help me with the snippet which uses a specific template while creating this page and update the issue key in the Jira issue/ filter macro in the template.
TIA!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ash,
I do not have an exact example that I can share with yourself that uses a specific template and updates the Jira Issue filter/ macro on a page as you require.
However, I can confirm that the example snippet that I shared yesterday which is located here shows an example of how to create a Confluence page.
I can confirm that in this example the storageFormat variable is where the content of the page is defined and you will be able to modify this section to specify the page template that you require.
This is where you will specify the details for the Jira issue/filter macro that you require to display on the page.
I can confirm the easiest way to see what the page template looks like, is to create a page with the template that you require in Confluence and then to view the storage format for the page by viewing the page source as this will show the structure of the page and will give you the structure you will need for your script.
I hope this helps.
Regards,
Kristian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you @Kristian Walker _Adaptavist_
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Kristian Walker _Adaptavist_ Thanks for the inputs.
We tried using storageFormat but when we have multiline text, we are getting HTTP 500 error and when we put everything in a single line just like in screenshot, its working fine.
Please confirm if any further attributes to be considered if we want to customize the page as we want to insert macros.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Yellisetty,
I can confirm that to specify the storage format over multiple lines you need to define a multi-line string which in Groovy is defined by using three speech marks such as """ as described in the page located here.
I can confirm we have an example of this in the documentation example located here which you will be able to use for your reference and I would advise using the syntax used in this example to define the storage format and rest request to create the Confluence page.
Regards,
Kristian
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.