Add Attachments with REST API

Sujaira Moughawiche January 18, 2021

Greetings,

I am working with Power Automate to create issues in Jira automatically, however the Jira plugin for Power Automate doesn't allow to add an attachment, so I have been trying to use the HTTP action on Power Automate with the Method post to add the attachments, but so far it's not working. 

I tried to test it with Postman as well with the same result. 

HTTP-Action-Power-Automate.png

Any ideas of what could be the problem, the error code it's showing me is: 404 XSRF check failed.

Thanks

2 answers

1 accepted

2 votes
Answer accepted
Martin Bayer _MoroSystems_ s_r_o__
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 18, 2021

hi @Sujaira Moughawiche you just need to add header to the request (as described in https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-attachments/#api-rest-api-3-issue-issueidorkey-attachments-post):

  • X-Atlassian-Token: no-check

I just tested and it is working. Complete request configuration looks like:

Selection_116.pngSelection_115.pngSelection_114.png

Sujaira Moughawiche January 20, 2021

Thanks @Martin Bayer _MoroSystems_ s_r_o__  It works on Postman now but still not working on Power Automate. I am trying to pass the File Content on the body but it's showing error 500. 

Martin Bayer _MoroSystems_ s_r_o__
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 20, 2021

I do not know Power Automate, can you share more information, screenshot of the configuration...?

Sujaira Moughawiche January 20, 2021

The picture on my original post shows the HTTP action that Power Automate has available. I think the issue could be on how the file it's attach to the body. 

Martin Bayer _MoroSystems_ s_r_o__
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 20, 2021

I am sorry, I tried to google it but with no luck. It is definitely more about Power Automate, so it would be great to check with someone who knows this tool.

Sujaira Moughawiche January 20, 2021

Yes it does looks like an issue on Power Automate. Thanks. 

Sudar January 9, 2022

Hi @Martin Bayer _MoroSystems_ s_r_o__ , 

Cany you help me to create cookie in the header?

Suggest an answer

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

Atlassian Community Events