Describe the issue/error/question
I want to shorten this json to everything below subtasks
I have no idea how, since I am not into java
First try was
for (item of item) {
item.json.NewItem = item.json[“issues”];
}
works, but I do not know how to get better
PLUS
the data are only added below the original json
something like
var part_of_json = item.json[“issues”];
return part_of_json;
seems not to work
[
{
"expand": "names,schema",
"startAt": 2,
"maxResults": 1,
"total": 64,
"issues": [
{
"expand": "operations,versionedRepresentations,editmeta,changelog,renderedFields",
"id": "635145",
"self": "https://jiraabna.dfd-hamburg.de/rest/api/2/issue/635145",
"key": "DCSERV-7325",
"fields": {
"subtasks": [
{
"id": "635184",
"key": "DCSERV-7364",
"self": "https://jiraabna.dfd-hamburg.de/rest/api/2/issue/635184",
"fields": {
"summary": "Subtask 1",
"status": {
"self": "https://jiraabna.dfd-hamburg.de/rest/api/2/status/1",
"description": "The issue is open and ready for the assignee to start work on it.",
"iconUrl": "https://jiraabna.dfd-hamburg.de/images/icons/statuses/generic.png",
"name": "Open",
"id": "1",
"statusCategory": {
"self": "https://jiraabna.dfd-hamburg.de/rest/api/2/statuscategory/2",
"id": 2,
"key": "new",
"colorName": "blue-gray",
"name": "To Do"
}
},
"issuetype": {
"self": "https://jiraabna.dfd-hamburg.de/rest/api/2/issuetype/10000",
"id": "10000",
"description": "Die Unteraufgabe des Vorgangs",
"iconUrl": "https://jiraabna.dfd-hamburg.de/secure/viewavatar?size=xsmall&avatarId=13107&avatarType=issuetype",
"name": "Unteraufgabe",
"subtask": true,
"avatarId": 13107
}
}
},
{
"id": "635185",
"key": "DCSERV-7365",
"self": "https://jiraabna.dfd-hamburg.de/rest/api/2/issue/635185",
"fields": {
"summary": "Subtask 2",
"status": {
"self": "https://jiraabna.dfd-hamburg.de/rest/api/2/status/1",
"description": "The issue is open and ready for the assignee to start work on it.",
"iconUrl": "https://jiraabna.dfd-hamburg.de/images/icons/statuses/generic.png",
"name": "Open",
"id": "1",
"statusCategory": {
"self": "https://jiraabna.dfd-hamburg.de/rest/api/2/statuscategory/2",
"id": 2,
"key": "new",
"colorName": "blue-gray",
"name": "To Do"
}
},
"issuetype": {
"self": "https://jiraabna.dfd-hamburg.de/rest/api/2/issuetype/10000",
"id": "10000",
"description": "Die Unteraufgabe des Vorgangs",
"iconUrl": "https://jiraabna.dfd-hamburg.de/secure/viewavatar?size=xsmall&avatarId=13107&avatarType=issuetype",
"name": "Unteraufgabe",
"subtask": true,
"avatarId": 13107
}
}
}
]
}
}
],
}
]
``