Hi All,
I am consuming Jira rest issue API using java(rest/api/2/issue/10010).This API contains attachment i have to download and place some folder to that attachment using java based on the parsing URL."secure/attachment/10011/AttachmentAnalysis.txt".But i am able to place file but not getting content .this file contains 302 Found comment.could you please help on this.
rest/api/2/issue/10010.
Regards,
Nageswara K.
Need to disable redirection when making the GET call. If you use RestSharp, you can do client.FollowRedirects = false or http.FollowRedirects = false.
And then check that response status code 302 and read the location header. The location header contains the actual link to download the attachment.
302 is an indication of redirection. Users have posted similar questions in the past such as
In some cases the problem is with the way you are authenticated. In others, users have provided specific code you can use in order to download and store that data into a file such as that in https://community.atlassian.com/t5/Jira-questions/How-do-I-upload-attachment-to-JIRA-Issue-via-REST-API/qaq-p/545073 In that thread Loic posted both an upload/download code in order to handle attachments.
If this is not helpful in your case, please tell us more about your use case here? Are you creating a java plugin to download attachments? I have the feeling that this error might be due to the way the Jira site is handling authentication and in turn the request to grab that specific file is prompting your request to login first before you can view that file.
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.