Attachments added via the REST API are not visible to other users

Ed Adjei
Contributor
April 26, 2019

Hi All,

 

When I add an issue with attachments using the REST API, other members of my team cannot see the attachments when they go into JIRA. When I log into JIRA, I can see the attachments fine.

 

Has anyone else experienced this or know a solution? I have a feeling it might be something to do with the level of permissions, but why JIRA allows the text of the issue to be visible but then hides the attachments is beyond me.

 

Regards.

Ed

1 answer

1 vote
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 29, 2019

Hi Ed,

I too am scratching my head at this one.  At first I thought this might be a difference between either a next gen project and a Classic project in Jira Cloud, but I don't see any difference in the way attachments are presented in these two.

It could be different in a Jira Service Desk project, but only in regards to what Agents and other licensed users see vs what customers can see in the customer portal.  In those cases, the customer portal does not show all attachments to the issue unless the agent's share them with the user.

But from looking up your account, I don't believe your site is even using Service Desk here.

There should be no difference between uploading an attachment in the web vs via REST API.   Jira does not natively have field level security, so I can't see a way for only you to be able to see attachments via the permissions and then restrict other users.  If they can browse the same issue as you, they should also be able to see the same fields including attachments.

Are these users looking at these issues directly (under a /browse/{ISSUEKEY} link for example)?   Or are they trying to look at the issues on a board of some kind?

I have come across particular workflow properties that might be able to restrict which users can see/edit/add attachments when an issue is in a current status, However this would apply to the workflow in use for that project, and would not be dependent upon REST uploads vs web uploads.

 

Have you tried to upload attachments in the web instead?  Are these other users able to see these?

What specific REST API endpoint are you using to upload these attachments?  I ask because there is a v2 and a v3 set of REST endpoints for Jira Cloud right now. I'm curious to learn which you might be using here in case there is something different between the two. 

 

Is the issue in question publicly available?  I'm just curious to learn if perhaps the end users that can't see these attachments are logged into Jira or not.  If the issue was public, these users might not have to login to see the issue.  Just curious if we can learn more here.

Andy

Ed Adjei
Contributor
April 30, 2019

Hi Andy,

 

In answer to your questions.

 

Are these users looking at these issues directly (under a /browse/{ISSUEKEY} link for example)? 

YES

 

Or are they trying to look at the issues on a board of some kind?

NO, just https://project.atlassian.net/

 

Have you tried to upload attachments in the web instead? 

YES, I can upload attachments in the WEB

 

Are these other users able to see these?

YES, other users are also able to see my uploads but not those from the production user that is setup to automate the creation of issues and attachments via the REST API.

 

 

What specific REST API endpoint are you using to upload these attachments? 

https://project.atlassian.net/rest/api/2/issue/ $issue_id/attachments

 

Is the issue in question publicly available? 

I doubt it. That endpoint needs authentication

 

Ed

Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 30, 2019

Hi Ed,

Thanks for answering these questions.  I'm afraid I don't know what else could cause the behavior you have described here. So I have created a support ticket on your behalf that you can access at https://getsupport.atlassian.com/servicedesk/customer/portal/23/JST-471753

Someone from our Cloud support team can take a closer look at your Cloud site to see if there is some problem with the site, or some configuration difference that might be causing this unexpected behavior.

Regards,

Andy

Connor Rosenthal September 17, 2024

@Ed Adjei @Andy Heinzer  Was there ever an answer to this? That support link does not exist anymore. I am hitting the attachments api2 and uploading attachments to tickets, however, end users cannot see the attachments.

https://COMPANY.atlassian.net/rest/api/2/issue/{{ $json.itTicket }}/attachments

Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 17, 2024

Hi @Connor Rosenthal 

The support case seemed to indicate that the problem was in regards to the user account making that REST API call might not have had the permission to create attachments within the project where that attachment would be stored.  Also there was a note that using the v2 endpoint might be lacking in the response given when there is a permissions failure.

Perhaps using the v3 endpoint of the same name might be more helpful as well.

Connor Rosenthal September 17, 2024

Hey, thank you for the response, unfortunately not as there's no parameter or flag to set as public similar to the comment endpoint.

curl --location --request POST 'https://your-domain.atlassian.net/rest/api/3/issue/TEST-123/attachments' -u 'email@example.com:<api_token>' -H 'X-Atlassian-Token: no-check' --form 'file=@"myfile.txt"'

 

However I have made a workaround. I can upload the attachment and reference it in a public comment.

 

Thank you

Vlad
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 23, 2024

 

(deleted, was my mistake)

 

Suggest an answer

Log in or Sign up to answer