Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Hi all,
we're using a lot of fields in our integrity items, and very often the fieldnames are not the same as the display names. To help our users to indentify which name they should use (maybo for queries or so) we want to put the fieldname into the description of the field itself, so the user could look at the tooltip of any field to get the real fieldname.
So we tried to add the fieldname to the mostly existing description, and we dont want to do this with the admin client, because this would be a horrible clickwork (for more than thousand fields).
We've written a script and within this script we're using the CLI-commands to read the fields, then we parse out the description (which is also a pain) and we tried to use the CLI-commands also to write the new description. But how can you put a multiline description via CLI into the system?
An example: This is a description how it exists today, and how it was edited via the admin client:
This is a description with at least three lines last line
The new description should look like this:
Systemname: Testfield This is a description with at least three lines last line
But i dont know how to put this text with the line breaks into the commandline for "im editfield" as a value for "--description="? I tried several kinds of escaping with "\n" or "chr(13)" or ASCII-Code etc. Always with one of two possible results: Either I got an error when executing the command, because the command line didn't appear to be complete anymore (because it ends at the first line break), or I get a single line with the complete text (maybe together with non-escaped escape-sequences) as description.
Any idea?
Thanks in advance,
Jens
Solved! Go to Solution.
Hallo Jens,
hm, looks like the usual carriage returns don't work here.
I would propose to implement this Task with Java. Pretty sure that it works then.
Hope this helps
Volker
Hallo Jens,
hm, looks like the usual carriage returns don't work here.
I would propose to implement this Task with Java. Pretty sure that it works then.
Hope this helps
Volker
Hello @JensN.,
I have to concur with @VolkerEckardt. You'll have to do it through Java.
Kind Regards,
-Kael
Hi @VolkerEckardt, hi @KaelLizak,
thank you for your answer. Frankly, I was expecting an answer like yours, but i didn't want to shoot sparrows with cannons. But it seems that i have to 😉
kind regards, Jens
Hi Jens,
Sorry you have to resort to that cannon. I tried all of the easy stuff I could think of, even backticking with Linux shell, and none of it worked.
-Kael
Please use the solution I provided in the above discussion topic.
Thank you,
Balu