Apply Label Template in URL format for field not null

Hi,
I have a field name Issue Link which contain either a url or empty.
My url is quite long so i want to shorter it, i use Url format in data view and set custom label to "Bug".
And the output in kibana:


It also apply to null value in Issue Link field but i want to apply label for only value is not null here, is there anyway to accomplish this.

To display a custom label in Kibana only when the Issue Link field has a URL (and leave it blank when empty), you can use a scripted field. This will allow the label to appear only in cases where the link is actually present.

Hi Thiago,
Thanks for the solution, but when i apply your script, it is shown as image below, the scripted field here is "test", is there something that i am missing.