cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Getting local tenant url in JavaScript (Workflow or any other JS Code)

andreas_grabner
Dynatrace Guru
Dynatrace Guru

Hi

I am currently developing a workflow that is eventually sending a message to an external Chat Systems with a link back to the Dynatrace Environment that executes the workflow.

I would like that workflow to not have a hard-coded Dynatrace Tenant URL included so that I can more easily share that workflow. My question now: Is there anything in JavaScript that allows me to retrieve the current Tenant URL? And in particular for workflows - is there any global context variable that I can use in most of our Workflow tasks, e.g: Http Request as a jinja expression, e.g: {{ .currentTenant.url }}?

Thanks

Contact our DevRel team through devrel@dynatrace.com
2 REPLIES 2

michal_zawislak
Dynatrace Advisor
Dynatrace Advisor

Hi Andreas,

To get an environment URL in the JavaScript action, you can use globalThis.environmentUrl. Please see the related question. Please beware that this is available only in the JavaScript action, and currently, we don't have any alternatives for other actions.

I'll take your suggestion and discuss it with the team.

 

Your AutomationEngine ally!

Thanks! That helps a lot already. Would be great if this could also be provided as Workflow Context Values so that every action can also use this easily through e.g: jinja expressions

Contact our DevRel team through devrel@dynatrace.com

Featured Posts