Highlighted
nils.guenther@t Honored Contributor.
Honored Contributor.
500 views

Global Variables in case names

Good morning community,

I like to have the end time of correlated event in case names. The use of $endTime works like charm. What I do not like is the time zone string (In my case always MESZ). To strip that from the output I use the following Velocity expression: $endTime.substring(0, $endTime.lastIndexOf(' ')) This works as expected in Local Variables and in custom columns in Active Channels. So it cannot be completely wrong. But it does not seem to work in Global Variables. When I put this into a Global Variable "ShortEndTime" and use $ShortEndTime in case name, the reference is generated into the case name as literal string rather than the evaluated value. What am I doing wrong?

Thanks in advance,

Nils

Labels (1)
0 Likes
Reply
3 Replies
Acclaimed Contributor.. Volker Michels Acclaimed Contributor..
Acclaimed Contributor..

Re: Global Variables in case names

Hello Nils,

a case has no endTime ... only a creationTime etc. that's why it is not working.

Volker

0 Likes
Reply
nils.guenther@t Honored Contributor.
Honored Contributor.

Re: Global Variables in case names

Hi Volker,

yeah a case does not, but the correlated event does. Using the reference $endTime works. Following your hint I have now experimented with Event-Global/Case-Global Variables using a Velocity Expression that simply returns a literal string "Test". That does not work either. So my conclusion is that global variables cannot be used in case creation. Hope to be proven wrong though...

0 Likes
Reply
nils.guenther@t Honored Contributor.
Honored Contributor.

Re: Global Variables in case names

I write the velocity expression $endTime.substring(0, $endTime.lastIndexOf(' ')) directly into the case name field. This spares me from using variables. Might not be beautiful, but works.

0 Likes
Reply
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.