How to get the stack from url and link it to grafana dashbopard data link

Hi, I want to extract the url and use it in grafana data links .is there a variable I can use in order to get the url.

for example i’m on test stack so my data link is :

and if i’m on playing stack i expected a data link like this :

Do we have a way to get the stack like a ${__data.fields.jid} or with a global variable ?
I’m trying with a relative URL but it’s not working
Thank for your time.