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

When does the .getModifiedBy() value change for an IChangeSet?

Hello All,

I have a scenario wherein i need to get all the Workspaces of a CS Owner.

So I use : Changeset.getAuthor().

However I found another API CS.getModifiedBy()...From the API Docs i came to know, that if there are changes in the CS then we get the Modifier else it remains null.

I wanted to know, in which all cases/scenarios we get this Modifier value.

Please assist on this.
Thank you.

0 votes



One answer

Permanent link
The .getAuthor() method exists on IChangeSet and the .getModifiedBy() method exists on IItem (Note: IChangeSet extends IItem so it picks this up.).

.getAuthor() has semantic meaning by SCM and is meant to represent the person who is responsible for the changes in the change set, .getModifiedBy() has semantic meaning more at the foundation/database layer, and is really meant to represent the person who is responsible for the 'new state of that item in the database'.

For your use case I would only use .getAuthor() and just forget about the method provided by IItem.

To be specific though:
-change sets first get created, in which case the .getAuthor() and .getModifiedBy() would be the same person:
(Note: Since IItem is 'generic' in a way, the Javadoc suggests that the .getModified() might be null for newly-created items [ex: it might be programmatically possible to create an item without assigning a modifier]. I don't think this is the case for change sets though.)

-check-ins (commits) create a new state of the change set. In this case the .getAuthor() and .getModifiedBy() would be the same person.

-completing/closing a change set creates a new state of the change set. In this case the .getAuthor() and .getModifiedBy() would be the same person.

-Note there is a rare case where the .getAuthor() of a change set can change. If a repository workspace has an active change set, and if an admin changes the owner of that workspace to himself, then he can now check-in and complete the change set, which would change the .getAuthor() to him.

-Modifying a change set comment also creates a new state of the change set. In this case however, it's possible for someone else to modify the change set comment after it has been closed. In which case the .getAuthor() does not change (it still represents the person who did the file changes in the change set), but the .getModifiedBy() method would return the person that just changed the comment.

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,927
× 1,201
× 149

Question asked: Oct 24 '18, 8:23 a.m.

Question was seen: 2,754 times

Last updated: Oct 24 '18, 10:35 a.m.

Confirmation Cancel Confirm