Accessing fields in .json file
<p>I was following this article (<a href="https://www.visualstudio.com/docs/integrate/extensions/develop/add-dashboard-widget" rel="nofollow">https://www.visualstudio.com/docs/integrate/extensions/develop/add-dashboard-widget</a>) to create a widget to add it to microsoft dashboard. </p>

<p>In my html file, there is this piece of code that I cannot get to work:</p>

<pre><code>...(some code above)
return TFS_Wit_WebApi.getClient().getRevision(284,6)
                        .then(function (query) {

                            var $list = query.rev;        
                            var $container = $('#query-info-container');
                            $container.empty();
                            $container.append($list);

... (some code below)
</code></pre>

<p>In this line: </p>

<pre><code>  var $list = query.rev; 
</code></pre>

<p>I'm trying to get access to .json file "rev" variable.</p>

<p>Here is my .json file  </p>

<pre><code>    {
      "count": 15,
      "value": 
      [
        {
          "id": 284,
          "rev": 1,
          "fields": {
            "System.WorkItemType": "User Story",
            "System.State": "New",
            "System.Reason": "New",
            "System.CreatedDate": "2016-06-23T14:31:37.567Z",
         }, 

...(some code below)
</code></pre>

<p>And I'm able to get access to this "rev" variable. </p>

<p>However, now I want to get access to "fields", namely to </p>

<pre><code>"System.State": "New",
</code></pre>

<p>Instead of </p>

<pre><code>var $list = query.rev; 
</code></pre>

<p>I tried </p>

<pre><code>var $list = query.fields.System.WorkItemType[0]; 
And 
var $list = query.value.fields[0];
and 
var $list = query.fields; 
</code></pre>

<p>However, that did not work.</p>

<p>Here is some documentation on how it is supposed to be accessed </p>

<pre><code>fields: {[key: string]: any}.
</code></pre>

<p>But it is not much of a help.</p>

<p>Any help will be greatly appreciated!
Thank you!</p>