Adding SessionID to url in a dynamic field

Moderator: crythias

Locked
Elrengil
Znuny newbie
Posts: 6
Joined: 09 Aug 2012, 15:50
Znuny Version: 3.1.2
Real Name: Gleb
Company: Bank

Adding SessionID to url in a dynamic field

Post by Elrengil »

HI,

Please tell me how to add the SessionID (otrs SessionID ) to the link in the dynamic field?

I only khow how to add ticket number to the link/
I am using centos and OTRS 4.0.9
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Adding SessionID to url in a dynamic field

Post by crythias »

This value disappears, even from database history, and is not usable for most things.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Elrengil
Znuny newbie
Posts: 6
Joined: 09 Aug 2012, 15:50
Znuny Version: 3.1.2
Real Name: Gleb
Company: Bank

Re: Adding SessionID to url in a dynamic field

Post by Elrengil »

it's not about the database. SessionID is a user variable. I read in the manual, it seems to be available as a $ Env {'SessionID'}
artjoms15
Znuny advanced
Posts: 121
Joined: 30 Aug 2011, 10:48
Znuny Version: 3.3.8 && 4.0.9
Real Name: Artjoms Petrovs
Location: Latvia

Re: Adding SessionID to url in a dynamic field

Post by artjoms15 »

Hey, Elrengil!

This one is really easy.
Just edit the according .dtl you want this dynamic field to appear and add the following lines of JavaScript at the end of the .dtl file

Code: Select all

<!--dtl:js_on_document_complete-->
<script type="text/javascript">//<![CDATA[

document.getElementById('DynamicField_test').value = "$Env{"SessionID"}";

//]]></script>
Where DynamicField_test should be replaced with your Dynamic field name

NB! You should add a check, whether this field is present in this window, otherwise you might get a browser notification on a javascript function used on an undefined value.
Ar cieņu / Kind regards,
----------------------------------------
Artjoms Petrovs
Sistēmu analītiķis/Programmētājs /
Systems Analyst/Programmer
Locked