[GH-ISSUE #2350] templating engine not processing variables (Global Key Store and Agent variables fail) #3394

Closed
opened 2026-03-14 07:15:39 +03:00 by kerem · 3 comments
Owner

Originally created by @ninjoan on GitHub (Nov 16, 2025).
Original GitHub issue: https://github.com/amidaware/tacticalrmm/issues/2350

Hi team, I'm experiencing an issue where the Jinja2 templating engine seems to be completely disabled or non-functional for my scripts.

Both Global Key Store variables ({{global.}}) and standard Agent variables ({{agent.}}) are not being replaced. The literal template string is passed directly to the agent.

Steps to Reproduce

  1. Created a Global Key Store variable named HolA.
  2. Went to an agent > Scripts > "Run Script".
  3. Executed the following PowerShell script to log the output:
# Test script 1: Global Key Store
$logPath = "C:\Temp\trmm_key_test.log"
$valorSecreto = "{{global.HolA}}"
$logContent = "Valor recibido: $valorSecreto"
Set-Content -Path $logPath -Value $logContent
  1. Also tested with agent variables:
# Test script 2: Agent Variables
$logPath = "C:\Temp\trmm_engine_test.log"
$hostname_agente = "{{agent.hostname}}"
$id_agente = "{{agent.agent_id}}"
$logContent = "Hostname: $hostname_agente`nAgent ID: $id_agente"
Set-Content -Path $logPath -Value $logContent
  1. My Environment
    TacticalRMM Version: v1.2.0
Originally created by @ninjoan on GitHub (Nov 16, 2025). Original GitHub issue: https://github.com/amidaware/tacticalrmm/issues/2350 Hi team, I'm experiencing an issue where the Jinja2 templating engine seems to be completely disabled or non-functional for my scripts. Both Global Key Store variables ({{global.*}}) and standard Agent variables ({{agent.*}}) are not being replaced. The literal template string is passed directly to the agent. ### Steps to Reproduce 1. Created a Global Key Store variable named HolA. 2. Went to an agent > Scripts > "Run Script". 3. Executed the following PowerShell script to log the output: ``` # Test script 1: Global Key Store $logPath = "C:\Temp\trmm_key_test.log" $valorSecreto = "{{global.HolA}}" $logContent = "Valor recibido: $valorSecreto" Set-Content -Path $logPath -Value $logContent ``` 4. Also tested with agent variables: ``` # Test script 2: Agent Variables $logPath = "C:\Temp\trmm_engine_test.log" $hostname_agente = "{{agent.hostname}}" $id_agente = "{{agent.agent_id}}" $logContent = "Hostname: $hostname_agente`nAgent ID: $id_agente" Set-Content -Path $logPath -Value $logContent ``` 5. My Environment TacticalRMM Version: v1.2.0
kerem closed this issue 2026-03-14 07:15:44 +03:00
Author
Owner

@wh1te909 commented on GitHub (Nov 16, 2025):

this is not how the templating engine works. you need to pass them in as script arguments or environment variables, not directly in the script. check this video for an example: https://www.youtube.com/watch?v=uWdzxbJjrm4

<!-- gh-comment-id:3539346882 --> @wh1te909 commented on GitHub (Nov 16, 2025): this is not how the templating engine works. you need to pass them in as script arguments or environment variables, not directly in the script. check this video for an example: https://www.youtube.com/watch?v=uWdzxbJjrm4
Author
Owner

@P6g9YHK6 commented on GitHub (Nov 17, 2025):

one day you need to implement this.
everyone is getting it wrong but if intuitively people do it like this it should be the way to go

<!-- gh-comment-id:3541593318 --> @P6g9YHK6 commented on GitHub (Nov 17, 2025): one day you need to implement this. everyone is getting it wrong but if intuitively people do it like this it should be the way to go
Author
Owner

@ninjoan commented on GitHub (Nov 17, 2025):

one day you need to implement this. everyone is getting it wrong but if intuitively people do it like this it should be the way to go

thanks you!

<!-- gh-comment-id:3542566245 --> @ninjoan commented on GitHub (Nov 17, 2025): > one day you need to implement this. everyone is getting it wrong but if intuitively people do it like this it should be the way to go thanks you!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tacticalrmm#3394
No description provided.