Is there any REST API available to create bulk issues using the jira csv importer (for Jira Software Server)? I want to import bulk issues through code and looking for an api to help me do that.
@anamika25Welcome to the community!
There is no API to create issue using CSV file. But with little bit of script/code you can solve this. Here are steps you need to follow,
For details about how to use API please refer to this article - https://developer.atlassian.com/server/jira/platform/jira-rest-api-examples/
Thank you @DPKJ for your response. Could you also guide me on which wrapper is available/best for node js (v 12 or higher) JIRA Software server (v 7 or higher) REST API calls? I am trying to call the JIRA REST API through node js code to perform crud operations.
The requirements are the basic CRUD operations, for example:
There are many libraries available in Node ecosystem to call rest api's. Most popular that I know of are,
You can use whatever fits you best.
You don't need to worry about permissions etc, as each API will give you appropriate message if you don't have permission to use it.
On authentication, I think in first go you should Basic Authentication which is super easy to use - https://developer.atlassian.com/server/jira/platform/basic-authentication/
Here is an example Node JS code to get issue using Issue Key from Jira,
// I am using 'request' library here var request = require('request'); var SERVER_URL = "PUT JIRA SERVER URL HERE";var USERNAME = "PUT YOUR LOGIN USERNAME HERE";var PASSWORD = "PUT YOUR JIRA LONG PASSWORD HERE";var issue_key = "PUT KEY OR ID OF ISSUE YOU WANT TO FETCH HERE";var options = { method: 'GET', url: SERVER_URL + '/rest/api/2/issue/' + issue_key, auth: { username: USERNAME, password: PASSWORD }, headers: { 'Accept': 'application/json' } }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log( 'Response: ' + response.statusCode + ' ' + response.statusMessage ); console.log(body); });
Unfortunately this is not really an acceptable answer.The REST API has validation rules on "create issue" that probably wouldn't / shouldn't apply to a scenario where you would be importing items in bulk.For example, you can only add fields that are in the "create" screen for that issue type. So if you want to add say "description" and that isn't on your create screen but is on your edit screen then you get the api error:
"description": "Field 'description' cannot be set. It is not on the appropriate screen, or unknown."
Likewise, setting things like "status" is impossible on the create action.In a bulk scenario like a csv / json import you would probably have a selection of items in various states of status and fields that are likely not on the create issue screen.
It looks like you're new here. Sign in or register to get started.