Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No variables substitute in email step when using Format DateTime #4735

Closed
KennethBates opened this issue Jul 18, 2018 · 4 comments
Closed

No variables substitute in email step when using Format DateTime #4735

KennethBates opened this issue Jul 18, 2018 · 4 comments
Assignees
Labels
action/investigate kind/bug This issue represents a verified problem we are committed to solving
Milestone

Comments

@KennethBates
Copy link

Octopus 2018.6.15

Steps to reproduce

  1. Create an email step
  2. in the body, include system variables (i.e. #{Octopus.Project.Name}) along with the MyDate variable with formatting (shown in blog post: https://octopus.com/blog/octostache-json-formatting#formatting)
    It'll look something like this:
A successful deployment of #{Octopus.Project.Name} in the #{Octopus.Environment.Name} environment on #{ | NowDate | Format DateTime \"HH dd-MM-yyyy\"} has occurred.

Result: The email writes out just that without any of the variables substituting, including the system variables.

Workaround: If you remove the escape from the quotes (#{ | NowDate | Format DateTime "HH dd-MM-yyyy"}), all variables in the body are substituted as expected.

Source: https://help.octopus.com/t/octopus-project-name-and-other-variables-not-being-replaced-in-email-body/20792

@KennethBates KennethBates added kind/bug This issue represents a verified problem we are committed to solving area/execution labels Jul 18, 2018
@droyad
Copy link
Contributor

droyad commented Oct 9, 2018

This would be due to the evaluation aborting due to an error and then just returning the original string. We should look into whether we can easily just skip over that one. If not, close as wont-fix

@zentron zentron closed this as completed May 23, 2019
@zentron zentron added this to the 2018.10.8 milestone May 23, 2019
@zentron
Copy link

zentron commented May 23, 2019

Although Octostache is currently built to fail to replace any variables if the expression contains invalid variable patterns, a fix has been added to provide a warning if this takes place since it is understandable that a block of text like the body is much more likely to encounter this problem.
Not that if a variable cannot be found, the other variables in the body will still be replaced

@zentron
Copy link

zentron commented May 23, 2019

Release Note: Provide warning if email body fails to evaluate variables

@zentron zentron modified the milestones: 2018.10.8, 2019.5.5 May 23, 2019
@matt-richardson matt-richardson added this to the 2019.5.5 milestone May 27, 2019
@lock
Copy link

lock bot commented Aug 25, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. If you think you've found a related issue, please contact our support team so we can triage your issue, and make sure it's handled appropriately.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action/investigate kind/bug This issue represents a verified problem we are committed to solving
Projects
None yet
Development

No branches or pull requests

4 participants