Hi,
Following the Jira API instructions on creating an issue here:
https://developer.atlassian.com/server/jira/platform/rest-apis/
https://developer.atlassian.com/server/jira/platform/jira-rest-api-examples/
I have a JSON file with multiple records; how do I get ALL of the records created as Jira issues when I do a POST to the https://[hostname]/rest/api/2/issue/ endpoint?
If I leave out the array tags "[" and "]" at the beginning and end of the file respectively, then when I do a post, only the first record is created. If I include those array tags, then I get an error:
Can not deserialize instance of com.atlassian.jira.rest.v2.issue.IssueUpdateBean out of START_ARRAY
Thanks,
Tim
Hello,
You should use the POST /rest/api/2/issue/bulk endpoint:
https://docs.atlassian.com/software/jira/docs/api/REST/7.12.0/?_ga=2.15474545.675557620.1538152808-65270402.1526147845#api/2/issue-createIssues
Thank you, I didn't know about that endpoint. But now I'm getting this error:
{"errorMessages":["No issue data was provided by request"],"errors":{}}
I confirmed that I have valid json in my file.
How did you confirm that you have a valid Json? Jira says there is no issue data.
I just dumped the data into an online validator tool (I used https://jsonlint.com/). In any case, I was able to do this a different way by using the original issue endpoint and then just iterating over each JSON object and creating issues one by one.
It looks like you're new here. Sign in or register to get started.