cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Test Result Attachments with API

nborrerojr.
7-Bedrock

Test Result Attachments with API

When I try to run the tm createresult to add a test result via the API, I try to use the addAttachment command to add a file with the test result. The documentation for 10.5 says:

 

--addAttachment=value

adds attachments, where value is of the form "field=fieldName,path=pathToFile[,name=nameOfAttachment][,summary=shortDescription] "

.

Note: The "pathToFile" must include the path and filename. The "nameOfAttachment" is optional, and gives the attachment a different

name than the name of the file specified in "pathToFile".

For example,

addAttachment="field=Attachments,path=c:/temp/notes.txt,name=notes123.txt,summary="Notes for issue 123""

 

When I try to do this, I get an error that says "Could not create test result: Error adding attachment" The specified key is invalid: field".

How is this invalid? Isn't this exactly what to documentation says to use?

 

 

If I remove "field=Attachments" completely then i get another error. This one says "

 

Could not create test result: File paths must be rooted in /opt/plm/IntegrityServer10/data/tmp: InternalFile set to /opt/plm/IntegrityServer10/bin/C:\Users\myaccount\Documents\Visual Studio 2013\...

The path seems to be a concatenation of where the existing file is on my computer and where it should be stored on the server.

 

Message was edited by: Nolin Borrero Jr.

1 ACCEPTED SOLUTION

Accepted Solutions

https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS170271&source=minisearch appears to deal with the first part. Typo in the documentation. Do not include field=Attachments.

https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS156509&source=minisearch may deal with the second part. Digging into this more now.

View solution in original post

3 REPLIES 3

https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS170271&source=minisearch appears to deal with the first part. Typo in the documentation. Do not include field=Attachments.

https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS156509&source=minisearch may deal with the second part. Digging into this more now.

Tried the fix in the second article and I get a different error. Now it says it's unable to parse the response.

Figured it out. My issue was with extra quotes when trying to make the code match the example.

Announcements