I want to programmatically create Jazz Source Control User properties using Java API
Hello,
I am migrating file revisions into RTC from a differrent change control system. There needs to be a file revision property on each repository file such that we can check it against the files changed for the work items I will also be migrating. I can programmatically extract the necessary property from the metadata in the previous tool, but can see no obvious way of adding this data as a Jazz Source Control User Property automatically. Please help...
Cheers,
Richard
3 answers
https://www-01.ibm.com/support/knowledgecenter/SSCP65_4.0.6/com.ibm.team.scm.doc/topics/set_property.html?cp=SSCP65_4.0.6&lang=en
Comments
If possible, use the SCM commandline as suggested by Geoff. If not, please see https://rsjazz.wordpress.com/2013/10/15/extracting-an-archive-into-jazz-scm-using-the-plain-java-client-libraries/ for hints on the Java SCM API.
This code should allow you to set user properties.
IFileItem fileWorkingCopy = (IFileItem) aFile.getWorkingCopy();
fileWorkingCopy.setContent(storedzipContent);
fileWorkingCopy.setUserProperty("MyProperty", "MyValue");
fWorkspace.commit(fChangeSet, Collections
.singletonList(fWorkspace.configurationOpFactory()
.save(fileWorkingCopy)), fMonitor);
Comments
Still having an issue getting hold of all the files in a sandbox so I can write loads of file propeties using the java API, Need to cast my files to something that resembles an IFileItem so I can add metadata to each - a pointer would be appreciated! Looked at the snippets and a couple of blog articles, missing an obvious trick I expect.
Cheers
Richard