I'm trying to call a ScriptRunner method from a domain different than the one used with Jira. Using JavaScript I'm making a cross-domain request, and receiving the following error:
Access to XMLHttpRequest at '<<jira url>>' from origin '<<non-jira url>>' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
There is a ScriptRunner method that accepts GET methods, which is working fine, but this appears when trying to use a POST method.
I'm fairly certain I have all of the CORS pieces setup, except for allowing of the pre-flight OPTIONS request.
It seems that this won't work without the OPTIONS method being supported by the `httpMethod` parameter in the Groovy ScriptRunner script.
Any ideas how to get this to work?
Is this a custom rest endpoint you are calling?
Have you tried the method at https://jira.atlassian.com/browse/JRASERVER-65362 ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And yes, we did what mention in the ticket u mentioned.
the issue is that when calling Jira oob post api it is working fine in Jira 8.13.7
bit when calling script runner rest endpoint it fails…
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Alright... to confirm, when you call one of the standard jira rest APIs with a POST, from another domain, it is working fine. But when you call a ScriptRunner rest endpoint, it is not.
The behaviour would be the same ideally. Please can you create a support request at https://productsupport.adaptavist.com/servicedesk/customer/portal/2 then we will reproduce and advise, or try to fix if it's something we are missing.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Jamie Echlin _ScriptRunner - The Adaptavist Group_ - hi jamie,
can u response the above post?
thanks,
Erez
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.
Hi,
anyone have an answer to the above question? i am facing same issue as well when trying to call script runner rest end point that do POST command.
when i call a jira OOB API it is working fine
thanks,
Erez
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.