06.01.2023, 17:01
I have a Object with the following structure:
I want to get specific values from the object with:
uid: String(WorkItem.id),
url: WorkItem.url,
type: String(WorkItem.fields.System.WorkItemType),
name: WorkItem.fields.System.Title,
For id and url everything works fine but for the fields.System values I get "Error processing input: Cannot read properties of undefined" How can I get the values fro the fields.System properties? I tried a different synthax but everything failed.
Code:
{
id: 9215,
rev: 8,
fields: {
"System.Id": 9215,
"System.AreaId": 277,
"System.AreaPath": "GisAtWeb",
"System.TeamProject": "GisAtWeb",
"System.NodeName": "GisAtWeb",
"System.AreaLevel1": "GisAtWeb",
"System.Rev": 8,
"System.AuthorizedDate": "2021-01-28T13:15:15.623Z",
"System.RevisedDate": "9999-01-01T00:00:00Z",
"System.IterationId": 269,
"System.IterationPath": "GisAtWeb",
"System.IterationLevel1": "GisAtWeb",
"System.WorkItemType": "Task",
"System.State": "Done",
"System.Reason": "Work finished",
"System.CreatedDate": "2021-01-27T16:20:49.98Z",
"System.CreatedBy": {
displayName: "Schulze, Markus",
url: "****",
_links: [Object],
id: "b5d776ba-c31e-6957-8ec4-5623fe2b1118",
uniqueName: "Markus.Schulze@vwfsdev.com",
imageUrl: "****",
descriptor: "aad.YjVkNzc2YmEtYzMxZS03OTU3LThlYzQtNTYyM2ZlMmIxMTE4"
},
"System.ChangedDate": "2021-01-28T13:15:15.623Z",
"System.ChangedBy": {
displayName: "Dominic Taubald",
url: "****",
_links: [Object],
id: "8270861f-3fe2-6e7d-a347-ec9f1ecd20f2",
uniqueName: "Dominic.Taubald@vwfsdev.com",
imageUrl: "****",
descriptor: "aad.ODI3MDg2MWYtM2ZlMi03ZTdkLWEzNDctZWM5ZjFlY2QyMGYy"
},
"System.AuthorizedAs": {
displayName: "Dominic Taubald",
url:
"https://spsprodweu4.vssps.visualstudio.com/A511b7ce7-5e78-4cdc-b847-d020b420fde2/_apis/Identities/8270861f-3fe2-6e7d-a347-ec9f1ecd20f2",
_links: [Object],
id: "8270861f-3fe2-6e7d-a347-ec9f1ecd20f2",
uniqueName: "Dominic.Taubald@vwfsdev.com",
imageUrl: "****",
descriptor: "aad.ODI3MDg2MWYtM2ZlMi03ZTdkLWEzNDctZWM5ZjFlY2QyMGYy"
},
"System.PersonId": 81022228,
"System.Watermark": 78852,
"System.CommentCount": 0,
"System.Title":
"[20210127] Deployment Task - Changelog aktualisieren / prüfen gegen Deployment-Script",
"Microsoft.VSTS.Common.StateChangeDate": "2021-01-28T13:15:15.623Z",
"Microsoft.VSTS.Common.ClosedDate": "2021-01-28T13:15:15.623Z",
"Microsoft.VSTS.Common.ClosedBy": {
displayName: "Dominic Taubald",
url: "****",
_links: [Object],
id: "8270861f-3fe2-6e7d-a347-ec9f1ecd20f2",
uniqueName: "Dominic.Taubald@vwfsdev.com",
imageUrl: "****",
descriptor: "aad.ODI3MDg2MWYtM2ZlMi03ZTdkLWEzNDctZWM5ZjFlY2QyMGYy"
},
"Microsoft.VSTS.Common.Priority": 2,
"System.Description":
'<div><b><u>Changelog:</u></b></div><div><br></div><div>Folgende Konfigurationen müssen im Deployment-Script berücksichtigt werden:</div><div><br></div><div><ul><li>Konfiguration der Route über IDP ohne BlueCoat Proxy (ICAP Virenscanner Komponente) ist im APIM Korrekt hinterlegt. (<span style="font-size:11.0pt;font-family:"Calibri",sans-serif;">Statt <i>fsb-gateway.vwfs.com</i>\n' +
'wird <i>gateway-cert.vwfs.com </i>mit SSL verwendet) Siehe Screenshot</span></li><li><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;">Anpassung Deployment-Script, wenn das Zertifikat manuell im Portal geändert wurde: Anpassung Fingerprint (Zertifkats-Id) im Deployment-Script</span></li><li><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;"><br></span></li></ul></div><div><br><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;"></span></div><div><img src="https://dev.azure.com/vwfs/55bf3504-405f-46ad-a342-fb8edcf4913f/_apis/wit/attachments/21e69dea-3b77-4baa-bc80-e4f4b6bbd370?fileName=sc.jpg" alt=sc.jpg><br></div>'
},
_links: {
self: {
href: "****"
},
workItemUpdates: {
href: "****"
},
workItemRevisions: {
href: "****"
},
workItemComments: {
href: "****"
},
html: {
href: "****"
},
workItemType: {
href: "****"
},
fields: {
href: "****"
}
},
url: "link"
};
I want to get specific values from the object with:
uid: String(WorkItem.id),
url: WorkItem.url,
type: String(WorkItem.fields.System.WorkItemType),
name: WorkItem.fields.System.Title,
For id and url everything works fine but for the fields.System values I get "Error processing input: Cannot read properties of undefined" How can I get the values fro the fields.System properties? I tried a different synthax but everything failed.