Access Jira RESTful API by cURL
*******INSTRUCTION FOR GETING RECORDS FROM JIRA by cURL*****************
Jira supply RESTfull API, so we can use cURL to get data. Below is the steps,
1. Install cURL;
2. Use curl to send a Http GET request, the command is as below,(1k records per request);
curl -D- -o c:/jiratest.txt -u username:password -X GET -H "Content-Type: application/json" http://10.255.7.140:8080/rest/api/2/search?jql="key>CM-7266&maxResults=1000"
3. Edit c:/jiratest.txt, to remove the header and separater(,)
4. Create DB & Collection (jira.jiratest),
> show databases;
jira 0.203GB
local 0.078GB
> use jira
switched to db jira
> show collections;
jiratest
system.indexes
>
5. Importing the JSON to Mongodb with below command;
mongoimport -d jira -c jiratest c:/jiratest.txt
6. Done.