Skip to content

ContextResolver Identity.Read values not working in EnsureOutOfOffice template substitution #254

@ntt-matthias-fleschuetz

Description

@ntt-matthias-fleschuetz

Description

Using the values from Request.Context.Identity.Profile.* in template substitution with EnsureOutOfOffice and EXO provider doesn't work and brings an error on plan creation.

Steps to Reproduce

  1. Step with
@{
            Name = 'EXO - Set OOO message'
            Type = 'IdLE.Step.Mailbox.EnsureOutOfOffice'
            With = @{
                IdentityKey = '{{Request.IdentityKeys.sAMAccountName}}@nanotempertech.com'
                Provider = 'EXO'
                AuthSessionName = 'EXO'
                Config = @{
                    Mode = 'Enabled'
                    InternalMessage = 'Dear Sender,<br/>{{Request.Context.Identity.Profile.DisplayName}} is not working at NanoTemper anymore.<br/>Your email is not forwarded and will be deleted automatically, due to legal compliance.<br/>For further contact please mail to: {{Request.Context.Manager}}. <br/>Best, <br/> NanoTemper Technologies'
                    ExternalMessage =  'Dear Sender,<br/>{{Request.Context.Identity.Profile.DisplayName}} is not working at NanoTemper anymore.<br/>Your email is not forwarded and will be deleted automatically, due to legal compliance.<br/>For further contact please mail to: {{Request.Context.Manager}}. <br/>Best, <br/> NanoTemper Technologies'
                    ExternalAudience = 'All'
                    MessageFormat = 'HTML'
                }
            }
        }
  1. Run plan after initializing $providers, $workflowfile and $request properly
$plan = New-IdlePlan -WorkflowPath $workflowFile -Request $request -Providers $providers

Expected Behavior

Being able to resolve this path from Context and substitute in Message for OutOfOffice.

Actual Behavior

Error on plan

Line | 
 115 |              throw [System.ArgumentException]::new(
     |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Template resolution error in step 'EXO - Set OOO message': Path 'Request.Context.Identity.Profile.DisplayName'        
     | resolved to null or does not exist. Ensure the request contains all required values. (Parameter 'Workflow')

Additional Context

Without error step I can see the values for the EnsureOutOfOffice Message clearly in the profile:

{ 
  "IdentityKey": "max.power",
  "Enabled": false,
  "Attributes": {
    "Title": "High Performer",
    "Surname": "Power",
    "DistinguishedName": "CN=Max Power,OU=some,OU=Folder,DC=corp,DC=domain,DC=tld",
    "DisplayName": "Max Power",
    "Description": "OFFBOARDING Stage I - 2026-02-30",
    "Department": "High Performance IT",
    "GivenName": "Max",
    "UserPrincipalName": "max.power@domain.tld",
    "EmailAddress": "max.power@domain.tld",
    "sAMAccountName": "max.power"
  }
}

Environment

  • PowerShell version: 7.5.4
  • OS: Windows Server 2019
  • IdLE version / commit: main
  • Execution context (CLI / Service / CI): CLI

Metadata

Metadata

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions