Question on variable to read in current user information

Hello,

I’m trying to find a variable that can be used to read the currently logged in users username or email (as provided from SAML) for use during a reconfigure (Morpheus 5.4.5 in this case)

Historically, the only variable we could find that existed was the <%=instance.createdByEmail%>, but revisiting this I found the
morpheus.user.email
morpheus.user.username
morpheus.user.attributes

In testing, it appears at least the morpheus.user.email value must be pulling from what instances JSON and not the active user session as the displayed value for that variable matched the instance.createbyemail value, is that true?

I’m looking to find a way to read the currently logged in users email or at least username so when a reconfigure is done we can have a Workflow Task email both the listed VM Owner (as occurs now) but also the actual person who did the reconfigure so they know that task was done and completed.

Any suggestions on what variable could be used to read this value in would be greatly appreciated.

Thanks!

Ah yeah those variables are set at creation to capture and reference later. On option lists there’s an input.user.username/email/etc that takes the account the executing person. I can test and see if those are available against an instance for your intended use.

1 Like

From my testing, when running a workflow against an instance (or a task using the context of an instance), it will provide the information you mentioned from that instance metadata. If you run a task ad-hoc but don’t specify an instance as a context, it will return the user info running the task, but then you don’t have access to the data from the instance.

I’d recommend adding this as an Idea in the Ideas section of the forums.

2 Likes

Thanks @kgawronski . For those interested looks like this is the Idea created.

1 Like