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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

How to attach a file to a CR from command line

hmagnanao
1-Newbie

How to attach a file to a CR from command line

Is there a command line that attaches a file to a Change Request ?

5 REPLIES 5

You can add an attachemnt to any item type by using the "im editissue" command with the "--addAttachment" or "--updateAttachment" parameter.

The syntax is "im editissue --addAttachment="field=<FieldName>,path=<c:/path/to/file/filename.xyz>" <itemID>"

There is additional documentation on this command in the CLI reference for Workflows and Documents pdf.

Hi Matt,

I'm trying to Attach a file to an Item using JAVA API calls and was succeded (running API call using Local Client). However i'm not able to attach a file to an Item by running the same Java API call at Server side. I'm getting the below error.

"Could not save item: File paths must be rooted in C:\Program Files\Integrity\IntegrityServer10\data\tmp: InternalFile is set to C:\Users\XXX.txt"

Would appreciate any suggestions.

I haven't attached any files from server side java, but from the error message, I think there may be some security feature so it only allows to upload files deep inside the Integrity Server's install directory (C:\Program Files\Integrity\IntegrityServer10\data\tmp).

With that said, you may want to open an official Support Case to make sure that bringing files into the \IntegrityServer10\data\tmp\ directory won't run into any issues with how Integrity itself uses that directory.

Hope that helps,

Matt

Hi Matt,

Thank you for your quick response. I'll try contacting PTC support on the above issue.

Meanwhile i have another question. As part of my Integrity client applciation testing exercise, i need to run IntegrityCleint.exe as a SYSTEM process. With the test tool i'm having i'm able to launch IntegrityClient.exe as a SYSTEM process but every time i'm executing COMMAND ( say IM createsegment etc) a new IntegrityClient.exe process is getting created and also i'm getting the below error. I'm not facing any issues while invoking this IntegrityClient.exe as an USER initiated process. I'm able to execute all the Commands sucessfully.

Error:-

"Attempt to launch Integrity Client timed out. To solve this please try the following: - Verify that the user you are logged in as has read and write permissions to the Integrity Client install directory. - Make sure the Integrity Client install directory is the very first entry in the path."

Would appreciate any suggestions. Thanks in advance.

I think there may be a few things happening.

1) Your test tool seems to be treating each command in a separate context, so try running the command as part of a script which includes "im exit --shutdown" at the end. This will close down the client at the end of each command so you don't create so many processes. Depending on how long your test tool runs, it may create so many integrity processes that it crashes your machine, so you wnat to make sure they get cleaned up as soon as posisble.

2) When there are multiple client instances running, they can start colliding on both the filesystem and the port level. To make sure this is not the case, follow the directions below for setting the integrity client to use a random port and avoid those collisions.

https://www.ptc.com/appserver/wcms/standards/ssl/freefull_cskdb.jsp??icg_dbkey=900&im_dbkey=146796

Hope that helps,

Matt

Top Tags