RTC SCM API examples
I need to set the user properties for a part and check it in programmatically.
I have tried the following => IChangeSetHandle cs1 = workspace.createChangeSet( component, monitor ); fileItem.setUserProperty( "testKey" , "TestValue" ); workspace.commit( cs1, Collections.singletonList( workspace.configurationOpFactory().save( fileItem ) ), monitor ); However this throws IllegalArgumentException without any additional detailed message. Is there any RTC SCM API documentation or examples that could shed light here? |
Accepted answer
IFileItem extends IItem and all items are copies that cannot be modified. You have to get a working copy of the IItem (ie. call #getWorkingCopy() on the item) before you can modify it. If you didn't know what a working copy was before then that is the issue you're encountering. You'll be fine once you change your code to get the working copy and set the user property on the working copy.
Ralph Schoon selected this answer as the correct answer
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.
Comments
Can you get a stack trace of the error?
At a glance, it seems like you didn't get the working copy for the file item. You need that before you can change anything on the versionable.
I don't know what you mean by "working copy for the file item".
I am using what seems to be a valid IFileItem object.
I tried to paste the stacktrace into this comment however when I do the "Post comment" button greys out. It must not like something about the stacktrack format.
Is there a trick to doing it?
That worked. Thanks