Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira REST API get attachments redirect to a login page

Dina Abezgauz
May 6, 2020

I have an electron app where users login in to their JIRA accounts using OAuth 2.0

I create a get request to /rest/api/2/search with Bearer authorization to get the issue list, get the attachment content url from the issue metadata and make a get request to /secure/attachment/{id} (without Bearer authorization)

Sometimes instead of redirection to attachment file I get an redirection to a login page
I think it could be because of expiration of cloud.session.token cookie (the expiry date is setting to now + 1 month)
If I delete cloud.session.token manually and try to make a request to attachment file I get the same result (redirection to a login page)
How can I prevent such behavior?

Thank you.
Regards.
Dina.

1 answer

0 votes
Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 11, 2020

Hello @Dina Abezgauz

Welcome to the Atlassian Community!

Per your description, I understand you have created a new app for Jira where you configured a REST API call to get the issue list, attachments and trigger another request, however, you are being redirected to a login page instead of the attachment file.

Since you are asking a development question, I believe you might ask for help in the Atlassian Developer Community:

https://community.developer.atlassian.com/ 

The mentioned portal was specifically created for development questions, where you will find articles and suggestions from other third-party partners and Atlassian developers.

Feel free to open a new topic about your question there! :)

Let us know if you have any other questions.

Dina Abezgauz
June 18, 2020

Hi @Petter Gonçalves 

Thank you for your answer.

I have repeated my question in the developer community https://community.developer.atlassian.com/t/jira-rest-api-get-attachments-redirect-to-a-login-page/38201 and I didn't get any answers, but the issue is still relevant to me.

Can you please help to promote my question?

Thanks.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events