Quantcast
Channel: PTC Community : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 11410

Need help with the im command-line and arguments with

$
0
0

Hi.

 

We are trying to create a utility that creates items with the 'im createissue" command from a DOS command-line. In this case it is a .bat file, but could be anything on the client-side. We're encountering errors when source data has embedded new-line characters, and we're wondering what the Integrity scripting engine does to handle new-line characters.

 

None of the on-line help or articles from Google searching have been helpful. We suspect that this is simple, once the trick is known.

 

A script that works:

   var cmd = new Packages.com.mks.api.Command("im","createissue");

   cmd.addOption( new Packages.com.mks.api.Option("type", "Functional Area") );

   cmd.addOption( new Packages.com.mks.api.Option("field", "Summary=" + functionalAreaDescription));

 

if the variable functioalAreaDescription has a value with an embeded newline, the scripting engine handles things.

 

If we build the command in a .bat to be executed on the client it turns out:

im createissue --type="Functional Area" --fields="Summary=some data

the other data"

 

And the DOS command parser considers this 2 commands and yields errors. We can translate the embedded newline in to some harmless character, but we lose the "newline. The internal command processor will perform the command and preserve the newline.What the 'special trick' that the Integrity execution engine is using that preserves the newline and follows the proper command-line syntax.

 

Please advise.

-Sean


Viewing all articles
Browse latest Browse all 11410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>