It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

JIRA REST API call from web application

Urja Patel Dec 09, 2014

I am trying to build web application from where my users can log issues related to application. Issues will be created in JIRA directly using rest api. I am trying to do the same but getting following error.

XMLHttpRequest cannot load https://knightscope.atlassian.net/rest/api/2/latest/?fields%5Bproject%5D%5B…nd+issue+type+names+using+the+REST+API&fields%5Bissuetype%5D%5Bname%5D=Bug. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8000' is therefore not allowed access.

 

Tried different solutions mentions in Q&A section. But nothings work. Any help will be appreciated.

2 answers

0 votes
Matheus Fernandes Atlassian Team Dec 10, 2014

Could you post the full request you're making to JIRA?

0 votes
Urja Patel Dec 10, 2014

Following is the piece of code I use to make request to JIRA.

$("#maintenanceSubmit").click(function(e){
     json = {
        "fields": {
             "project":{
                  "key": "SV"
              },
          "summary": "Create Trail issue.",
          "description": "Creating of an issue using project keys and issue type names using the REST API",
          "issuetype": {
                   "name": "Bug"
           }
       }
    }
$.ajax({
      type: "GET",
      url: "http://knightscope.atlassian.net/rest/api/2/latest/",
      dataType: "JSON",
      contentType: "application/json;",
      data: json,
      success: function (){
            console.log('Thanks for your comment!');
      }
   });

});

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Next-gen

Introducing subtasks for breaking down work in next-gen projects

Teams break work down in order to help simplify complex tasks. This is often done iteratively, with tasks being broken down into smaller tasks and so on until the work is accurately captured in well-...

9,604 views 35 43
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you