<?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 Accessing Task Context Variables in HPE Morpheus Enterprise</title>
    <link>https://community.hpe.com/t5/hpe-morpheus-enterprise/accessing-task-context-variables/m-p/7248235#M1409</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I’m working on scripts within Morpheus and am looking to retrieve more context information about the task that’s currently being executed. I know it’s possible to access variables like the ID, name, owner, and more of the instance in whose context the task runs (as per the Variables Examples &lt;A href="https://docs.morpheusdata.com/en/latest/troubleshooting/Variables_Examples.html" rel="noopener nofollow ugc"&gt;https://docs.morpheusdata.com/en/latest/troubleshooting/Variables_Examples.html&lt;/A&gt;).&lt;/P&gt;
&lt;P&gt;However, I’d like to retrieve details about the task itself within a script, specifically:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The name and ID of the task that’s currently executing&lt;/LI&gt;
&lt;LI&gt;The phase in which it’s being executed (e.g., post provisioning, reconfigure, etc.)&lt;/LI&gt;
&lt;LI&gt;The user who initiated the execution&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;These pieces of information are available in the UI and can be seen in the instance’s history, but I haven’t found a goos way to access them programmatically within a script. Without this, I’m unsure which task the current script is executing in.&lt;/P&gt;
&lt;P&gt;Is there a way to access these task context variables within a script? Any guidance or suggestions would be greatly appreciated.&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Tue, 17 Sep 2024 17:24:53 GMT</pubDate>
    <dc:creator />
    <dc:date>2024-09-17T17:24:53Z</dc:date>
    <item>
      <title>Accessing Task Context Variables</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise/accessing-task-context-variables/m-p/7248235#M1409</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I’m working on scripts within Morpheus and am looking to retrieve more context information about the task that’s currently being executed. I know it’s possible to access variables like the ID, name, owner, and more of the instance in whose context the task runs (as per the Variables Examples &lt;A href="https://docs.morpheusdata.com/en/latest/troubleshooting/Variables_Examples.html" rel="noopener nofollow ugc"&gt;https://docs.morpheusdata.com/en/latest/troubleshooting/Variables_Examples.html&lt;/A&gt;).&lt;/P&gt;
&lt;P&gt;However, I’d like to retrieve details about the task itself within a script, specifically:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The name and ID of the task that’s currently executing&lt;/LI&gt;
&lt;LI&gt;The phase in which it’s being executed (e.g., post provisioning, reconfigure, etc.)&lt;/LI&gt;
&lt;LI&gt;The user who initiated the execution&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;These pieces of information are available in the UI and can be seen in the instance’s history, but I haven’t found a goos way to access them programmatically within a script. Without this, I’m unsure which task the current script is executing in.&lt;/P&gt;
&lt;P&gt;Is there a way to access these task context variables within a script? Any guidance or suggestions would be greatly appreciated.&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 17:24:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise/accessing-task-context-variables/m-p/7248235#M1409</guid>
      <dc:creator />
      <dc:date>2024-09-17T17:24:53Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Task Context Variables</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise/accessing-task-context-variables/m-p/7248236#M1410</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;
&lt;P&gt;I had time to carry out some more tests today. Unfortunately, I wasn’t able to make any progress.&lt;/P&gt;
&lt;P&gt;When trying to retrieve the variable &amp;lt;%=task.id%&amp;gt; as an example, I get “No such property: task”.&lt;BR /&gt;
Since I know that there are the tables process and process_event in the Morpheus database, I also tried &amp;lt;%=process_event.id%&amp;gt; and &amp;lt;%=process.id%&amp;gt;, but also received the message that the property does not exist.&lt;/P&gt;
&lt;P&gt;Can you tell me if it is possible to retrieve the name and ID of the currently running task in any way?&lt;/P&gt;
&lt;P&gt;&lt;A class="mention" href="https://community.hpe.com/u/pjones"&gt;@pjones&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2024 10:19:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise/accessing-task-context-variables/m-p/7248236#M1410</guid>
      <dc:creator />
      <dc:date>2024-11-05T10:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Task Context Variables</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise/accessing-task-context-variables/m-p/7248237#M1411</link>
      <description>&lt;P&gt;I believe user.X will get you the data you need for whomever initiated.&lt;/P&gt;
&lt;P&gt;&lt;CODE style="background : #f0f1f2;"&gt;id,accountId,username,displayName,firstName,lastName,email,linuxUsername,windowsUsername&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;I think there’s a task name/id var too, but trying to confirm.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 17:32:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise/accessing-task-context-variables/m-p/7248237#M1411</guid>
      <dc:creator>cbunge</dc:creator>
      <dc:date>2024-09-17T17:32:23Z</dc:date>
    </item>
  </channel>
</rss>

