Skip to content

fix(bugfix): SendCustomHeaderForAddAttachmentApi as per the jira api … #152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

balaprasanna
Copy link
Contributor

@balaprasanna balaprasanna commented Aug 23, 2021

Hi @MrRefactoring and Team,

As per the JIRA Api doc,
We need to pass a custom header for Attachment api. (adding a new attachment to an issue)
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'

Issue: Without this header, currently the post request received error like XSRF check failed

Similar issues reported: https://ecosystem.atlassian.net/browse/ACJIRA-317

Please review the PR.
Thanks

@MrRefactoring
Copy link
Owner

Hi @balaprasanna! Thanks for your PR. Why using noCheckAtlassianToken: true not suitable for you?

const config = {
  host: '...',
  noCheckAtlassianToken: true,
};

@MrRefactoring
Copy link
Owner

I looked again at the Jira Cloud API specification for issue attachments and saw that this token is mandatory, so I'm adding this to the master branch. Thanks for the PR!

@MrRefactoring MrRefactoring merged commit 51c2456 into MrRefactoring:master Sep 1, 2021
@balaprasanna
Copy link
Contributor Author

Thanks @MrRefactoring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants