Skip to main content
1-Visitor
Jan 26, 2016 1:39 PM UTC
Question

exporting result from CLI command into XML

Good Morning,

I apologize if it is a dumb question as I very new to this .

We have a requirements in which I have to collect data via PTC integrity tool. I am thinking of creating batch file but before I want to run command manually to make sure I am getting desire results.

I get the results by running

im issues --query='query name' <== That will give me result in the CLI window

I am just wondering if I can get the result(s) in XML. and then run the next command which is

im viewissue <id>

and get the result in xml file.

Hope I explained it properly

10 replies

1-Visitor
Jan 26, 2016 1:49 PM UTC

Hi

You could use the --xmlapi flag and redirect output to a file.

--xmlapi won't be supported anymore in the future.

Using Java API instead of CLI is recommended.

Kind regards.

Thierry

Translate
mkhan-21-VisitorAuthor
1-Visitor
Jan 26, 2016 1:51 PM UTC

ok Thank you. it worked. In order to process the xml file to get the ID so I can run the Viewstate command. what is the right command to use.

attached is output I just need the value of ID field.

<?

<<Fie

for future use I don't even know where to look for Java API. can you help as well?

Thank you for your help

Translate
1-Visitor
Jun 10, 2016 6:21 PM UTC

The MKSAPIVIEWER command-line utility may be your best bet. It's a wrapper for the JAVA API that accepts most (perhaps all in 10.9) IM and SI commands and outputs them as XML.

mksapiview --iplocal --xml im issues --query='query name'

As was previously mentioned, the --xmlapi option will not be supported in the near future. It wasn't correct in many cases anyway. the MKSAPIVIEWER should have a longer life and doesn't require any additional coding.

Translate