Service Desk Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Passing Multi-Line Text-Fields sd_event

Highlighted
Michael Troitzs
Acclaimed Contributor

Passing Multi-Line Text-Fields sd_event

Hi,
We are opening incidents successfully with sd_event agaist HP ServiceDesk. We'd now like to fill the longer textfields with structured text containing NewLine characters.
The sd_event seems to convert the NewLines into "#" and then stumbles over these.

Has anybody successfully acomplished this task and can share the trick ?

Thanks, Michael
6 REPLIES

Re: Passing Multi-Line Text-Fields sd_event

Make a DB rule on create and put substitute action with replace your new line (# in my example) character with %line.separator%

Look on screenshot.

HTH,
Igor
Michael Troitzs
Acclaimed Contributor

Re: Passing Multi-Line Text-Fields sd_event

Igor,
thanks very much - a very good hint.
In experimenting over the weekend, I also have found another solution: When I send "\\n" instead of the newline, sd_event seems to transfer a real "\n" across. And this is then is seen as a correct newline again.
Cheers,
Michael
OFC_EDM
Collector

Re: Passing Multi-Line Text-Fields sd_event

Hi Michael,

Can you post your solution?

I'm trying to send \\n via sd_event and it's not coming through as a Newline.

Cheers
The Devil is in the detail.
Michael Troitzs
Acclaimed Contributor

Re: Passing Multi-Line Text-Fields sd_event

Hi Kevin,
sorry - I made a mistake. It's actually "\n" I'm sending accross - just in Perl its written "\\n" to make it "\n":
If have two Perl scripts, one prepares the text and uses following expressions
-- $text =~ s/#/+/g;
-- $text =~ s/\n/\\n/g;
to remove all "#" and to replace NewLines with literal "\n". $text is thenb written to a file, adn I can see the "\n" in there.
The second script then reads this text in (from the file) and passes it to sd_event:
...
-- $lb = `cat $filename`;
-- $vlist = "..... lb=\'$lb\' .....";
-- system "sd_event ... -v $vlist";
...
"lb" is the receiving field in HPSD, and I have included it in simple quotes when passing it to sd_event.

HTH,
Michael
OFC_EDM
Collector

Re: Passing Multi-Line Text-Fields sd_event

Thanks Michael.

The \n worked

Best Regards!
The Devil is in the detail.
Michael Troitzs
Acclaimed Contributor

Re: Passing Multi-Line Text-Fields sd_event

2 solutions found.
//Add this to "OnDomLoad" event