<?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: Workflow Condition to Run if AM Run a series of HTTP Requests  If PM Run Another series of HTTP Requests in Automations</title>
    <link>https://community.dynatrace.com/t5/Automations/Workflow-Condition-to-Run-if-AM-Run-a-series-of-HTTP-Requests-If/m-p/255045#M1779</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;you can use expression in the condition &lt;A href="https://docs.dynatrace.com/docs/platform-modules/automations/workflows/building#task-conditions" target="_blank" rel="noopener"&gt;https://docs.dynatrace.com/docs/platform-modules/automations/workflows/building#task-conditions&lt;/A&gt;&lt;BR /&gt;In this case, the now expression should be most useful &lt;A href="https://docs.dynatrace.com/docs/platform-modules/automations/workflows/reference#now" target="_blank" rel="noopener"&gt;https://docs.dynatrace.com/docs/platform-modules/automations/workflows/reference#now&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;With this, you can get the current timestamp in any format for any timezone and compare.&lt;BR /&gt;I suggest either to extract the current hour and compare with &amp;gt; &amp;lt; 12, or there is even a format to get AM / PM out. &lt;BR /&gt;&lt;BR /&gt;Sample condition:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;{{ now('US/Eastern').strftime("%p") == "PM" }}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ChristopherHejl_0-1725558456164.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/22219i7B0EB8E6ADDC2B75/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ChristopherHejl_0-1725558456164.png" alt="ChristopherHejl_0-1725558456164.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I'll also attach this sample workflow as an export so can either import it into your tenant and have a look or just look into the definition.&lt;/P&gt;</description>
    <pubDate>Thu, 05 Sep 2024 17:49:55 GMT</pubDate>
    <dc:creator>ChristopherHejl</dc:creator>
    <dc:date>2024-09-05T17:49:55Z</dc:date>
    <item>
      <title>Workflow Condition to Run if AM Run a series of HTTP Requests  If PM Run Another series of HTTP Requests</title>
      <link>https://community.dynatrace.com/t5/Automations/Workflow-Condition-to-Run-if-AM-Run-a-series-of-HTTP-Requests-If/m-p/255039#M1778</link>
      <description>&lt;P&gt;I have a dilemma where I am to create a maintenance window to prevent alerts from 6pm to 6am.&amp;nbsp; This is log ingestion via API, that does not contain many details to allow for a criteria for filtering to allow for a maintenance window.&amp;nbsp; SOOO, doing a work around using workflows to make an api call to Dynatrace to enable\disable the event extraction entities between 6pm and 6am.&lt;/P&gt;&lt;P&gt;So I have the api for enable\disable for the extraction event.&amp;nbsp; However, there is only one trigger and I have that set to run at 6am and 6pm.&amp;nbsp; BUT the condition I do not know the syntax for and I am not seeing any syntax for it in the documentation.&lt;/P&gt;&lt;P&gt;Condition would be to run is if time is AM run the Enable, if time is PM run disable api.&lt;/P&gt;&lt;P&gt;I am open to other conditions or ideas but it must be in 1 workflow as I only have 3 workflows to utilize.&amp;nbsp; I can use another workflow but I do not want to do that.&amp;nbsp; NOT a DPS customer yet.&amp;nbsp; In this layout both run at 6am and 6pm which enables and disables them and is doing nothing.&amp;nbsp; Also maintaining within one workflow for this one process keeps things organized.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CTull_1-1725553441147.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/22218iE1241C0AE4F6D696/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CTull_1-1725553441147.png" alt="CTull_1-1725553441147.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2024 19:54:45 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Workflow-Condition-to-Run-if-AM-Run-a-series-of-HTTP-Requests-If/m-p/255039#M1778</guid>
      <dc:creator>CTull</dc:creator>
      <dc:date>2024-09-05T19:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: Workflow Condition to Run if AM Run a series of HTTP Requests  If PM Run Another series of HTTP Requests</title>
      <link>https://community.dynatrace.com/t5/Automations/Workflow-Condition-to-Run-if-AM-Run-a-series-of-HTTP-Requests-If/m-p/255045#M1779</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;you can use expression in the condition &lt;A href="https://docs.dynatrace.com/docs/platform-modules/automations/workflows/building#task-conditions" target="_blank" rel="noopener"&gt;https://docs.dynatrace.com/docs/platform-modules/automations/workflows/building#task-conditions&lt;/A&gt;&lt;BR /&gt;In this case, the now expression should be most useful &lt;A href="https://docs.dynatrace.com/docs/platform-modules/automations/workflows/reference#now" target="_blank" rel="noopener"&gt;https://docs.dynatrace.com/docs/platform-modules/automations/workflows/reference#now&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;With this, you can get the current timestamp in any format for any timezone and compare.&lt;BR /&gt;I suggest either to extract the current hour and compare with &amp;gt; &amp;lt; 12, or there is even a format to get AM / PM out. &lt;BR /&gt;&lt;BR /&gt;Sample condition:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;{{ now('US/Eastern').strftime("%p") == "PM" }}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ChristopherHejl_0-1725558456164.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/22219i7B0EB8E6ADDC2B75/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ChristopherHejl_0-1725558456164.png" alt="ChristopherHejl_0-1725558456164.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I'll also attach this sample workflow as an export so can either import it into your tenant and have a look or just look into the definition.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2024 17:49:55 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Workflow-Condition-to-Run-if-AM-Run-a-series-of-HTTP-Requests-If/m-p/255045#M1779</guid>
      <dc:creator>ChristopherHejl</dc:creator>
      <dc:date>2024-09-05T17:49:55Z</dc:date>
    </item>
  </channel>
</rss>

