<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Unable to set JSON value in HTTP monitor | Postscript execution in Synthetic Monitoring</title>
    <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/Unable-to-set-JSON-value-in-HTTP-monitor-Postscript-execution/m-p/214457#M1893</link>
    <description>&lt;P&gt;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/41639"&gt;@VenkataSainath&lt;/a&gt;&amp;nbsp;were you able to get a work around or a solution to this issue?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 08 Jun 2023 14:09:12 GMT</pubDate>
    <dc:creator>ChadTurner</dc:creator>
    <dc:date>2023-06-08T14:09:12Z</dc:date>
    <item>
      <title>Unable to set JSON value in HTTP monitor | Postscript execution</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/Unable-to-set-JSON-value-in-HTTP-monitor-Postscript-execution/m-p/207270#M1753</link>
      <description>&lt;P data-unlink="true"&gt;I have below a sample response body, where I am able to set presignedURL but the orderId value is not working in the postscript.&lt;BR /&gt;&lt;BR /&gt;{&lt;BR /&gt;"presignedUrl": "https://abcd.com",&lt;BR /&gt;"status": {&lt;BR /&gt;"orderid": "CCIR#6bad551aa2724d60b8bf249c5dab8a7f",&lt;BR /&gt;"error_code": "",&lt;BR /&gt;"message": "",&lt;BR /&gt;"status": "SUCCESS"&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;When I tried the below postscript, it was giving syntax error.&lt;BR /&gt;if (response.getStatusCode() != 200) {&lt;BR /&gt;api.fail("HTTP error: " + response.getStatusCode());&lt;BR /&gt;}&lt;BR /&gt;var responseBody = response.getResponseBody();&lt;BR /&gt;var jsonData = JSON.parse(responseBody);&lt;BR /&gt;api.info(jsonData.presignedUrl);&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;api.setValue("oderid-1", jsonData.status.orderid);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;api.info(jsonData.status.orderid);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;}&lt;BR /&gt;Another way also I tried but still same error&amp;nbsp;&lt;BR /&gt;if (response.getStatusCode() != 200) {&lt;BR /&gt;api.fail("HTTP error: " + response.getStatusCode());&lt;BR /&gt;}&lt;BR /&gt;var responseBody = response.getResponseBody();&lt;BR /&gt;var jsonData = JSON.parse(responseBody);&lt;BR /&gt;api.info(jsonData.presignedUrl);&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;api.setValue("oderid-1", jsonData.status["orderid"]);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;api.info(jsonData.status.["orderid"]);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Did anyone know any suggestions?&lt;BR /&gt;&lt;BR /&gt;Regards, Venkat&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 11:57:35 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/Unable-to-set-JSON-value-in-HTTP-monitor-Postscript-execution/m-p/207270#M1753</guid>
      <dc:creator>VenkataSainath</dc:creator>
      <dc:date>2023-05-17T11:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to set JSON value in HTTP monitor | Postscript execution</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/Unable-to-set-JSON-value-in-HTTP-monitor-Postscript-execution/m-p/214457#M1893</link>
      <description>&lt;P&gt;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/41639"&gt;@VenkataSainath&lt;/a&gt;&amp;nbsp;were you able to get a work around or a solution to this issue?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 14:09:12 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/Unable-to-set-JSON-value-in-HTTP-monitor-Postscript-execution/m-p/214457#M1893</guid>
      <dc:creator>ChadTurner</dc:creator>
      <dc:date>2023-06-08T14:09:12Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to set JSON value in HTTP monitor | Postscript execution</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/Unable-to-set-JSON-value-in-HTTP-monitor-Postscript-execution/m-p/214632#M1894</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/14877"&gt;@ChadTurner&lt;/a&gt;&amp;nbsp;, Yes, I can able monitor now,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was doing mistake by using&amp;nbsp;request.setBody("requestBody"), Instead that I have passed "OrdeID" in body of the monitoring by using {OrderID}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Venkat&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 14:11:41 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/Unable-to-set-JSON-value-in-HTTP-monitor-Postscript-execution/m-p/214632#M1894</guid>
      <dc:creator>VenkataSainath</dc:creator>
      <dc:date>2023-06-09T14:11:41Z</dc:date>
    </item>
  </channel>
</rss>

