none
SharePoint to JIRA integration - creation of new request/incident in JIRA RRS feed

  • Question

  • Hi,

    We have created an integration between SharePoint and JIRA, A custom form is created in Vue.js on submitting the request in SharePoint form a item is created in a list and same request will be created in JIRA by using below code, It is working fine in IE but we are facing issue if we sumbit same request through chrome.

    Code to save request in JIRA:

                 

       $.ajax({
    
                            url: JIRARESTUrl,
    
                            type: "POST",
    
                            contentType: "application/json",
    
                            dataType: "json",
    
                            data: JSON.stringify(JIRAPayload),
    
                            headers: {    
    
                                    'Access-Control-Allow-Origin': '*',             
    
                                    "X-Atlassian-Token": "nocheck",               
    
                                    "Authorization": "Basic U0hQX1VTRVI8cjNzdV9waGM=",
    
                                    'Access-Control-Alow-Methods': 'POST, GET, PUT, OPTIONS, DELETE', 
    
                                     'Access-Control-Max-Age': '3600', 
    
                                     'Access-Control-Allow-Headers': 'x-requested-with, content-type, Authorization'
    
                                    },
    
                            success: function (data){
    
                                alert(“Issue created successfully”);
    
                            },
    
                            error: function (error) {
    
                                console.log(error);
    
                                alert("Error in creating Issue in JIRA: \n" + error.responseText);                          
    
                            }
    
                        });

    we are getting the below error on saving a request in JIRA through Chrome, let us know if any script or plugin is required to make this work in Chrome:

    Access to XMLHttpRequest at ‘https://jiratest.com/222/api/issue/’ from origin ‘http://mysharepoint.site.com’ 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.

    Thanks in Advance!!

    Wednesday, January 8, 2020 6:40 AM

All replies

  • Hi Charudath,

    Add the access url to Trusted Sites in Chrome browser to check if it works.

    And try to modify the code as below.

    jQuery.support.cors = true;
    $.ajax({
    	url: JIRARESTUrl,
    	type: "POST",
    	contentType: "application/json",
    	dataType: "json",
    	data: JSON.stringify(JIRAPayload),
    	crossDomain:true,
    	headers: {
    		'Access-Control-Allow-Origin': '*',
    		'X-Atlassian-Token': 'nocheck',
    		'Content-Type':'application/json',
    		'Authorization': 'Basic U0hQX1VTRVI8cjNzdV9waGM=',
    		'Access-Control-Alow-Methods': 'POST, GET, PUT, OPTIONS, DELETE', 
    		'Access-Control-Max-Age': '3600', 
    		'Access-Control-Allow-Headers': 'x-requested-with, content-type, Authorization'
    	},
    	success: function (data){
    		alert("Issue created successfully");
    	},
    	error: function (error) {
    		console.log(error);
    		alert("Error in creating Issue in JIRA: \n" + error.responseText);                          
    	}
    });

    Best Regards,

    Dennis


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Thursday, January 9, 2020 2:53 AM
    Moderator
  • Hi Charudath,

    Would you please provide us with an update on the status of your issue?

    Best Regards,
    Dennis

    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Friday, January 17, 2020 8:05 AM
    Moderator