how do I eport json to variables and access the values
Please see the JSON below. This is what I get in a ajax response. I am new to javascript and need some help. How do I set, for example the Fields(third line down) to it's own variable and then query the variable to show the subfield. for example fields.System.WorkItemType. As the System.WorkItemType has a dot in the middle of it does this make a different of how to get the value?
"id": 45,
"rev": 1,
"fields": {
"System.AreaPath": "H3P",
"System.TeamProject": "H3P",
"System.IterationPath": "H3P",
"System.WorkItemType": "User Story",
"System.State": "New",
"System.Reason": "New",
"System.CreatedDate": "2019-03-04T13:52:36.113Z",
"System.CreatedBy": {
"displayName": "BobOrgane",
"url": "
https://app.vssps.visualstudio.com/A7e32c6f3-e95b-44e0-ddf7-4778097d4065/_apis/Identities/a24f3e56-1c5c-4b6e-bc9e-f6293c784cc2",
"_links": {
"avatar": {
"href": "
https://dev.azure.com/BobOrgane/_apis/GraphProfile/MemberAvatars/msa.YWExNTNkYfktOTY5Yy03ZfFlLThmNTEtN2Y1fjlhZDA1Ey"
}
},
"id": "a20f3f56-1c5c-4b6e-bc9e-f6297c784cc1",
"uniqueName": "
BobOrgane@boborgane.com",
"imageUrl": "
https://dev.azure.com/organisation/_api/_common/identityImage?id=a20f3f56-4c5c-4b6e-bd9e-f6237c784cc1",
"descriptor": "msa.YWExNTNkYfktOTY5Yy03ZfFlLThmNTEtN2Y1fjlhZDA1Ey"
},
"System.ChangedDate": "2019-03-04T13:52:36.113Z",
"System.ChangedBy": {
"displayName": "BobOrgane",
"url": "
https://app.vssps.visualstudio.com/A7e32c6f3-e95b-44e0-ddf7-4778097d4065/_apis/Identities/a24f3f56-1c5c-4b6e-bc9e-f629ec784cc1",
"_links": {
"avatar": {
"href": "
https://dev.azure.com/organisation/_apis/GraphProfile/MemberAvatars/msa.YWExNTNsYTktOTY5ry03ZDFlLTgmNTEtN2Y1ZjlhZDA1Ey"
}
},
"id": "a20f3f56-1c5c-4b6e-bc9e-f6297c784cc1",
"uniqueName": "
BobOrgane@boborgane.com",
"imageUrl": "
https://dev.azure.com/organisation/_api/_common/identityImage?id=a20f3f56-1c5c-4b6e-bc9e-f6297ce84cc2",
"descriptor": "msa.YrExNTNkYTktOrY5Yy03ZDFlLTrmNTEtN2r1ZjlhZDA1Ey"
},
"System.CommentCount": 0,
"System.Title": "test",
"System.BoardColumn": "New",
"System.BoardColumnDone": false,
"Microsoft.VSTS.Common.StateChangeDate": "2019-03-04T13:52:36.113Z",
"Microsoft.VSTS.Common.Priority": 2,
"Microsoft.VSTS.Common.ValueArea": "Business",
"WEF_3A37B87DC2314411B6102E16FCA9EB7F_Kanban.Column": "New",
"WEF_3A37B87DC2314411B6102E16FCA9EB7F_Kanban.Column.Done": false,
"System.Description": "<div>test<br></div>"
},
"_links": {
"self": {
"href": "
https://dev.azure.com/organisation//ad61ff7e-989f-5d25-92df-ac4cb460wedf/_apis/wit/workItems/45"
},
"workItemUpdates": {
"href": "
https://dev.azure.com/organisation/ad61ff7e-989f-5d25-92df-ac4cb460wedf/_apis/wit/workItems/45/updates"
},
"workItemRevisions": {
"href": "
https://dev.azure.com/organisation/ad61ff7e-989f-5d25-92df-ac4cb460wedf/_apis/wit/workItems/45/revisions"
},
"workItemComments": {
"href": "
https://dev.azure.com/organisation//ad61ff7e-989f-5d25-92df-ac4cb460wedf/_apis/wit/workItems/45/comments"
},
"html": {
"href": "
https://dev.azure.com/organisation/web/wi.aspx?pcguid=fab264cc-ccbe-48c0-a543-b80d427c04bc&id=45"
},
"workItemType": {
"href": "
https://dev.azure.com/organisation//ad61ff7e-989f-5d25-92df-ac4cb460wedf/_apis/wit/workItemTypes/User%20Story"
},
"fields": {
"href": "
https://dev.azure.com/organisation//ad61ff7e-989f-5d25-92df-ac4cb460wedf/_apis/wit/fields"
}
},
"url": "
https://dev.azure.com/organisation//ad61ff7e-989f-5d25-92df-ac4cb460wedf/_apis/wit/workItems/45"
}