• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
ControlUp Community

ControlUp Community

Connect, Learn, and Grow

  • Blog
  • Archives
  • Findings
  • Videos
  • Categories
    • ControlUp One Platform
    • ControlUp for Apps
    • ControlUp for Compliance
    • ControlUp Dashboards
    • ControlUp for Desktops
    • ControlUp for VDI
    • ControlUp Scripts & Triggers
    • ControlUp Synthetic Monitoring
    • ControlUp Workflows
  • Topics
  • Meetups
  • Events
    • Logos & Wallpaper
    • ControlUp.com
  • Join

Including Template Variables in ControlUp ServiceNow Events

Posted on February 22, 2024

Users discussed how to include template variables such as $(Object), $(FQDN), $(ResourceType), and $(ObjectName) when creating ServiceNow events using the $CUTriggerObject. A suggestion was made to use the RESTful API or an intermediate method like a webhook or event follow-up action. @member confirmed that template variables cannot be used within the script itself, but only in follow-up actions.


Read the entire ‘Including Template Variables in ControlUp ServiceNow Events’ thread below:

Good day all,

We are working to implement a PoSH script to create ServiceNow events. We’re using $CUTriggerObject. and it’s sub classes for most variables, but really need to include data that resides within the template variables such as $(Object), $(FQDN), $(ResourceType), and $(ObjectName). Any ideas on how we can pull/expose those? We’ll call this SBA as an action in our triggers. The variables we’re interested in do not seem to be available classes from $CUTriggerObject.


Are you using the RESTful API follow up action and you are saying it does not correctly pass on template variables put in the body of the request?

Like so (https://support.controlup.com/v1/docs/using-webhooks-as-follow-up-action)


We’re not using the RestAPI, it would require us having too many templates, and quickly become untenable. We’re using a PoSH script as an SBA tied to triggers. Here’s what we’re able to include:

https://support.controlup.com/docs/automated-actions-how-to-pass-trigger-related-parameters

And we want to include data from these variables-

https://support.controlup.com/docs/template-variables


Ah ok, so I don’t think you can use template variables inside the script itself. The template variables are specifically for use in the follow up actions like email and restapi call

@member do you know?


Joel is correct. Only a subset is available in cutriggerobject


Any way to get those values using the SBA in another fashion?


You’d have to use an intermediate. I’ve shown you 2 examples

  1. use a webhook follow up action. The webserver receiving the webhook then processes the received data just like the powershell script would
  2. use an event follow up action. You’d then attach a powershell script to the event using a windows task scheduler task “when an event with these parameters is logged”

Continue reading and comment on the thread ‘Including Template Variables in ControlUp ServiceNow Events’.  Not a member? Join Here!


Categories: All Archives, ControlUp Scripts & Triggers
Topics: Automation & Alerting, Microsoft Windows, PowerShell, Scripts, Triggers

Ask Us Anything, Connect, Learn, and Grow with the ControlUp Community!

Login to the ControlUp Community to ask us anything, stay up-to-date on what’s new and coming soon and meet other like-minded techies like you.

Not already a member? Join Today!

Primary Sidebar

ControlUp Academy

Enroll in ControlUp Academy for expert-led technical training, equipping you with skills to effectively deploy, manage, and grow your ControlUp investment.

Learn here >

Rotating Images

Hidden Gem from our Community on Slack!

ControlUp Betas - What's Coming Next?
NEW ControlUp Features - Stay Up-to-Date!
ControlUp Scripts - Scripting, Zero to Hero
Latest KB Articles - Be the First to Learn

Video Tutorials Library

Visit our technical how-to videos, offering step-by-step tutorials on advanced features, troubleshooting, and best practices.

Watch here >

ControlUp Blog

Check out the ControlUp blog for expert advice and in-depth analysis.

Read here >

ControlUp Script Library

Visit the ControlUp technical script library, which offers a multitude of pre-built scripts and custom actions for your monitoring and troubleshooting requirements.

See here >

ControlUp Support

Visit the ControlUp support home and to delve deeper into ControlUp DEX solutions.

Browse here >

Footer

      

ControlUp Community
Of Techie, By Techie, For Techie!

Terms of Use | Privacy Policy | Security
Dive Deeper, Learn more at ControlUp.com

  • facebook
  • twitter
  • youtube
  • linkedin

© 2023–2026 ControlUp Technologies LTD, All Rights Reserved.

We use cookies to ensure that we give you the best experience on our website. by continuing to use this site you agree to our Cookie policy..