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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,463,473
Community Members
 
Community Events
176
Community Groups

Add attachment to a Confluence page with Jira cloud post function

Hello All,

I am using jira cloud and scriptrunner for jira cloud and I want to copy the jira issue attachment add that attachment to the confluence page on the post function.

I am able to get the issues attachment and also able to create the new page on the confluence.
But Im not able to add that attachment to the confluence.

How can I do that?

 

Thanks ,

Chinmay

2 answers

Hi,
I'm with Elements, and we just released a new app Elements Publish to Confluence that might meet your needs. The app allows you to create pages from Jira with issue data.

Elements-Publish-to-Confluence-create-from-Jira.png

If you want to learn more, check out this article that explains how to create Confluence pages linked to Jira issues with the app.

Let me know if you have any questions!

Julie :)

 

Hi @Julie d'Antin [Elements] ,

 

Thanks for your reply. As per your suggestion, I took a trail version of  Elements Publish to Confluence plugin and tested a lot to copy attachments from current issue to confluence. It is creating a page in confluence on workflow post function with all mentioned data EXCEPT attachments. 
I checked that I have enabled attachment option in the content module.

If you solved this, nothing like it for me.

Looking for your response.

 

Regards,

Chinmay

You can add attachment to a confluence page by sending a POST request to the /rest/api/content/<pageID>/child/attachment API method.

Example Curl Command -

curl -u $USER_NAME:$USER_PASSWORD -X POST -H "X-Atlassian-Token: nocheck" -F "file=@${ATTACHMENT_FILE_NAME}" -F "comment=File attached via REST API" ${CONFLUENCE_BASE_URL}/rest/api/content/${PAGE_ID}/child/attachment

Please change USER_NAME/USER_PASSWORD/ATTACHMENT_FILE_NAME/CONFLUENCE_BASE_URL/PAGE_ID as necessary in the above command.

 

Hi @Kishan Sharma ,

 

Thanks for the reply.

I am using scritrunner for jira cloud so that I want groovy script to add attachment. curl code will not work in this case.

Can you please suggest any other groovy script to run using scriptrunner ?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Site Admin
TAGS

Atlassian Community Events