<?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: Help in writing a JS code for workflow in Open Q&amp;A</title>
    <link>https://community.dynatrace.com/t5/Open-Q-A/Help-in-writing-a-JS-code-for-workflow/m-p/253538#M33465</link>
    <description>&lt;P&gt;Can somebody please share some thoughts on this.&lt;/P&gt;</description>
    <pubDate>Fri, 16 Aug 2024 21:14:27 GMT</pubDate>
    <dc:creator>AK</dc:creator>
    <dc:date>2024-08-16T21:14:27Z</dc:date>
    <item>
      <title>Help in writing a JS code for workflow</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Help-in-writing-a-JS-code-for-workflow/m-p/253526#M33464</link>
      <description>&lt;P&gt;Hi Folks,&lt;/P&gt;&lt;P&gt;Need some help in writing a JS code for workflow.&lt;/P&gt;&lt;P&gt;I'm using "&lt;SPAN&gt;Issue an HTTP request to any API" call to fetch the response and I wanted to objects from this response to next&amp;nbsp;"Issue an HTTP request to any API" call.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;As far as I know, we cannot pass objects directly from "Issue an HTTP request to any API" call to next step/call. We have to use "Build a custom task running js Code" to store the values/objects and use for next step or API call.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The body for first API call comprises of,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
    "objectId": "abscdf",
    "summary": "",
    "searchSummary": "",
    "created": 12345677,
    "modified": 78901234,
    "createdBy": "elstfsvs",
    "modifiedBy": "elstfsvs",
    "author": "someone@test.com",
    "updateToken": "123456absbdsld",
    "scope": "APPLICATION-123456xyz",
    "schemaId": "builtin:rum.web.rum-javascript-updates",
    "schemaVersion": "1.1",
    "resourceContext": {
        "operations": [
            "read",
            "write",
            "delete"
        ],
        "modifications": {
            "movable": true,
            "modifiablePaths": [],
            "nonModifiablePaths": []
        }
    },
    "value": {
        "JavascriptVersion": "CUSTOM"
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Based on&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;JavascriptVersion,&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;I wanted to pass application ID to next request which is actually POST api call.&lt;/P&gt;&lt;P&gt;I tried to write the below JS code, I'm able to get whole response body but how do I get those objects and pass it on to next API call.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;// optional import of sdk modules
import { execution } from '@dynatrace-sdk/automation-utils';
  export default async function({execution_id}) {
  const ex = await execution(execution_id); 
  const data = await ex.result('check_rum_version');
  console.log(data);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone help here.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;AK&lt;/P&gt;</description>
      <pubDate>Fri, 16 Aug 2024 13:22:11 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Help-in-writing-a-JS-code-for-workflow/m-p/253526#M33464</guid>
      <dc:creator>AK</dc:creator>
      <dc:date>2024-08-16T13:22:11Z</dc:date>
    </item>
    <item>
      <title>Re: Help in writing a JS code for workflow</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Help-in-writing-a-JS-code-for-workflow/m-p/253538#M33465</link>
      <description>&lt;P&gt;Can somebody please share some thoughts on this.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Aug 2024 21:14:27 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Help-in-writing-a-JS-code-for-workflow/m-p/253538#M33465</guid>
      <dc:creator>AK</dc:creator>
      <dc:date>2024-08-16T21:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: Help in writing a JS code for workflow</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Help-in-writing-a-JS-code-for-workflow/m-p/253551#M33468</link>
      <description>&lt;P&gt;I'm able to get this with below code.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;// optional import of sdk modules
import { execution } from '@dynatrace-sdk/automation-utils';
  export default async function({execution_id}) {
  const ex = await execution(execution_id); 
  const data = await ex.result('check_rum_version');
  const Scope = data[0].json.scope;
  return Scope;
  console.log(Scope);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Regards,&lt;/P&gt;&lt;P&gt;AK&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2024 18:30:15 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Help-in-writing-a-JS-code-for-workflow/m-p/253551#M33468</guid>
      <dc:creator>AK</dc:creator>
      <dc:date>2024-08-18T18:30:15Z</dc:date>
    </item>
  </channel>
</rss>

