Hello,
i am currently working on integrating JIRA with my application that is hosted on my SharePoint site. i create an angular app that lets user create JIRA issue from the form. i have already added my sharepoint site as a domain name and wildcard expression in the Whitelist of JIRA security settings bur after doing that it seems that its only working in IE. When i try to remove (xhr.setRequestHeader('Authorization', 'basic: '+make_base_auth(username, password));) in my header i get 400 error but not the CORS error. i think this issue is related to https://jira.atlassian.com/browse/JRASERVER-30371. im not sure i really need to get this to work but im stuck. do we have other workarounds for this?
this is my code snippet:
return $.ajax({ url: 'https://jira.xxxx.org/rest/api/2/issue/', type: "POST", data: parameters, contentType: 'application/json', dataType: 'JSON', async: false, processData: false, crossDomain: true, xhrFields: { withCredentials: true }, beforeSend: function (xhr) { xhr.setRequestHeader('Authorization', 'basic: '+make_base_auth(username, password)); }, error: function (errmsg) { console.log('error ocured:' + errmsg.statusText); }, success: function (text) { console.log(text); },
and this is my error in chrome:
XMLHttpRequest cannot load https://jira.xxxx.org/rest/api/2/issue/. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://xxxx.sharepoint.com' is therefore not allowed access.
my error in Edge:
SEC7120: Origin https://xxxx.sharepoint.com not found in Access-Control-Allow-Origin header.
SCRIPT7002: XMLHttpRequest: Network Error 0x80070005, Access is denied.
Hi Page,
I'm not sure about the code you posted, however, there is a knowledge base article titled CORS in JIRA - Server could not be contacted error during Create Issue modal dialog. It lists the cause as such:
Chrome and Safari include an Origin
header on same-origin POST/PUT/DELETE requests (same-origin GET requests will not have an Origin header). Firefox doesn't include an Origin
header on same-origin requests.
You can refer to this Communities post for more information.
The knowledge base lists the fix as follows:
Specify Origin as allowed in CORS configuration of JIRA's web.xml:
<init-param> <param-name>cors.supportedHeaders</param-name> <param-value>Origin</param-value> </init-param>
See if that helps.
Cheers,
Branden
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Page,
No worries. I hope that helps!
Cheers,
Branden
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ive asked our jira server admin to perform the necessary changes. will update you of it worked.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Branden,
may i ask what is the path of the web.xml file to be changed? our server team is asking me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.