- Community Home
- >
- Software
- >
- HPE Morpheus Software
- >
- HPE Morpheus Enterprise
- >
- Re: Accessing Task Context Variables
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2024 10:24 AM
09-17-2024 10:24 AM
Accessing Task Context Variables
Hello,
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 https://docs.morpheusdata.com/en/latest/troubleshooting/Variables_Examples.html).
However, I’d like to retrieve details about the task itself within a script, specifically:
- The name and ID of the task that’s currently executing
- The phase in which it’s being executed (e.g., post provisioning, reconfigure, etc.)
- The user who initiated the execution
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.
Is there a way to access these task context variables within a script? Any guidance or suggestions would be greatly appreciated.
Thank you!
- Tags:
- automation
- Variables

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2024 02:19 AM
11-05-2024 02:19 AM
Re: Accessing Task Context Variables
Hey,
I had time to carry out some more tests today. Unfortunately, I wasn’t able to make any progress.
When trying to retrieve the variable <%=task.id%> as an example, I get “No such property: task”.
Since I know that there are the tables process and process_event in the Morpheus database, I also tried <%=process_event.id%> and <%=process.id%>, but also received the message that the property does not exist.
Can you tell me if it is possible to retrieve the name and ID of the currently running task in any way?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2024 10:32 AM
09-17-2024 10:32 AM
Re: Accessing Task Context Variables
I believe user.X will get you the data you need for whomever initiated.
id,accountId,username,displayName,firstName,lastName,email,linuxUsername,windowsUsername
I think there’s a task name/id var too, but trying to confirm.