How do I upload attachment to JIRA Issue via REST API and make share it with customer?

Vahid_Azad January 15, 2020

Dear All,

 

I could successfully attach a file to a Jira issue, however, it's not publicly available, in other words, customers can not see the file.

I used curl for this integration and could not find a way to share the attachment.

any comment or suggestion is welcome.

Thanks

3 answers

1 accepted

2 votes
Answer accepted
Jack Nolddor _Sweet Bananas_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
January 15, 2020

Hi Vahid Azad,

By default customers cannot see attachments unless you share it within a public comment.

So I believe you must create a comment referencing the new file you've just uploaded using the folloing syntax:

images files:

!image-2020-01-10-08-36-21-609.png|thumbnail!

or for other files:

[^documentation.pdf]

 

 

Alternatively you can use a third-party app such as Extension for Jira Service Desk to allow attachments be viewed by customers.

 

Kind regards

Vahid_Azad January 15, 2020

Thanks Jack, I try creating a comment as well to see if it can be accessible. I will come back with the result.

0 votes
Vahid_Azad January 16, 2020

Hi all,

This worked perfectly for me:

 

curl -u admin:admin -X POST --data '{"body": "Please find the requested file attached. \n\n [^Document.ZIP] "}' -H "Content-type: application/json" http://localhost/rest/api/2/issue/TEST-123/comment

Jack Nolddor _Sweet Bananas_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
January 16, 2020

Glad to know :)

0 votes
Joe Pitt
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 15, 2020

Attachments are visible to user that can see the issue. You can't share an attachment outside of the issue. Can you customers see the issue? 

Vahid_Azad January 15, 2020

Attachments are not visible in the service desk which is the front-desk for the customers, it is indeed visible in the Jira but not in the customer view mode

Suggest an answer

Log in or Sign up to answer