Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How do I set the Change Set Owner using the Plain Java API?

 Hi,


I have written a Java app to import source code with version history using the Plain Java API.
I can set the file version date using the IFileItem.setFileTimestamp(date) but the Change Set owner and file modified by is being set to the logged in user.
Is it possible to set the Change Set's owner using the Plain Java API?

I found the internal method com.ibm.team.scm.common.internal.ChangeSet.setOwner(IContributorHandle value)  but how do I convert my IChangeSet into a ChangeSet object?
I also assume that the file version's Modified By is just a reference to the Change Set's owner?

Thank you,
Sudheer

0 votes



2 answers

Permanent link

You should not use internal methods and from the API or RTC clients you cannot change the change set owner. The change set owner is the one who has logged in to RTC and committed the changes or created the change set.

0 votes

Comments

 Hi Shashikant,


Thank you for the response. I do understand why the change set owner should be the logged in user in a normal daily flow of work.

However, does this then mean that we cannot develop our own custom code version history import tool, because we will be unable to set previous version owners?

As a workaround, I will just add the owner as part of the check-in comment, but I am unsure if my client would accept this solution.

Thank you,
Sudheer

After discussions with my client, they are happy to go with the 'Check-in comment to include the owner' solution. We will also be associating the change sets with work items, so we could set the WI owner as the file version owner.


So, happy to accept this answer.

Thank you,
Sudheer


Permanent link

After a bit more investigation with the Plain Java API, I came across this method:

IWorkspaceConnectionInteropAdapter.importChangeSet(
            IComponentHandle componentHandle, String changeSetComment,
            Collection configOps, long creationTime,
            IContributorHandle contributor, IProgressMonitor monitor)
This is exactly what I was looking for, and works perfectly for importing my source code history into RTC.

0 votes

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,937

Question asked: Oct 09 '17, 1:17 p.m.

Question was seen: 2,457 times

Last updated: Oct 12 '17, 8:39 a.m.

Confirmation Cancel Confirm