How to map response after creating bulk issues in JIRA

Hi Team,

I’m using JIRA cloud api to create bulk issues for my project. I’m processing a .csv file to read the issue properties before creating a payload. Once building the request payload the JIRA api will be called to create bulk issues (API: /rest/api/2/issue/bulk/). Assume that due to some problem(custom field not found) few issues are not created in JIRA. Now I’m unable to map the response to the respective issues.

Example:
input data for payload,

project_key,issue_type,issue_summary,issue_description,issue_labels,issue_assignee,issue_priority,issue_id,issue_macro
AWV,Bug,Sample bug,Creating bugs to test api,“AWV,sjye”,sjye,Major,
AWV,Task,Sample Test,Creating test,“Test,sjye”,sjye,Minor,
AWV,Task,Sample bug,Creating bugs to test api,“AWV,sjye”,sjye,Major,
AWV,Bug,Sample Test,Creating test,“Test,sjye”,sjye,Minor,

Response:
{
“issues”: [
{
“id”: “5962715”,
“key”: “AWV-18020”,
“self”: “https://jira-instance.net/rest/api/2/issue/5962715
},
{
“id”: “5962716”,
“key”: “AWV-18021”,
“self”: “https://jira-instance.net/rest/api/2/issue/5962716
}
],
“errors”: [
{
“status”: 400,
“elementErrors”: {
“errorMessages”: [],
“errors”: {
“customfield_10005”: “Regression is required.”,
“customfield_10003”: “Reproducibility is required.”
}
},
“failedElementNumber”: 0
},
{
“status”: 400,
“elementErrors”: {
“errorMessages”: [],
“errors”: {
“customfield_10005”: “Regression is required.”,
“customfield_10003”: “Reproducibility is required.”
}
},
“failedElementNumber”: 3
}
]
}

In the given input there are 4 issue rows available. Row 2 and 4 should fail while creating an issue. But after getting a response I don’t which response belongs to which issue. I mean unable to map the response to the respective issues.

Are there any way to map the response(success or error) to issues or do we need to create issues one by one (single issue at a time)?

Thanks,
Jayendran S

1 Like