How to create an issue in Jira using the REST API? I have tried the examples using curl. But I need to create defect in Eclipse using Java and REST API.
See: https://confluence.atlassian.com/display/IDEPLUGIN/Working+with+JIRA+Issues+in+Eclipse
Probably you'll need a REST client using the jersey-client artifact, I think this is the easiest way.
Firstly, check out the REST API documentation: https://docs.atlassian.com/jira/REST/latest/
With the POST method you can push a JSON object depiciting a wannabe issue to the JIRA server. You just have to exactly know what fields you can and should fill in. If you send fields that are not on the create issue screen, or is required but you haven't specified them, you'll get an error.
You can find an example here: http://pastebin.com/JeucUZNG