It's all about the answers!

Ask a question

programmatic way to change "modified by","cre


John Kelly (1231715) | asked Jan 26 '09, 8:46 a.m.
I've found the eclipse UI allows you to change the "Owned by" field when you right click in the area of the "Owned by" column.

We have an issue because due to problems with bug migration from Bugzilla we have ended up with two very similar users on the system.
(we use ldap for authentication which refers to jkelly as JKELLY@company.com

So our server already had JKELLY@company.com as a user, but the migration process also created a user called jkelly@company.com and set the
- Owned by
- Created by
- Modified by
- Resolved by
to be jkelly@company.com

Is there a programmatic way to fix this up, so i can modify ALL references to jkelly@company.com to be changed to JKELLY@company.com ?

7 answers



permanent link
Balaji Krish (1.8k12) | answered Jan 26 '09, 5:21 p.m.
JAZZ DEVELOPER
You should be able to fix the createdBy, OwnedBy and ResolvedBy fields. But modifiedBy field would be set to the user you logged in as when you ran the program.

To fix the fields, you need to do the following
1. Get the item id for user " jkelly@company.com" and "JKELLY@company.com". You can use contributorManager to perform this query
2. Perform a query to get all the Work items owned by / resolved by / created by " jkelly@company.com" item id. Use query service to perform this query.
3. replace " jkelly@company.com" item id with "JKELLY@company.com" item id and save the item.

--- Balaji

I've found the eclipse UI allows you to change the "Owned by" field when you right click in the area of the "Owned by" column.

We have an issue because due to problems with bug migration from Bugzilla we have ended up with two very similar users on the system.
(we use ldap for authentication which refers to jkelly as JKELLY@company.com

So our server already had JKELLY@company.com as a user, but the migration process also created a user called jkelly@company.com and set the
- Owned by
- Created by
- Modified by
- Resolved by
to be jkelly@company.com

Is there a programmatic way to fix this up, so i can modify ALL references to jkelly@company.com to be changed to JKELLY@company.com ?

permanent link
John Kelly (1231715) | answered Jan 28 '09, 11:43 a.m.
hey - thanks - very useful

also started to look at
https://jazz.net/learn/LearnItem.jsp?href=content/docs/hello-jazz/index.html

but can't seem to find
com.ibm.team.repository.service.serviceProvider

has some refactoring gone on since the example was written ?

regards
John

permanent link
John Kelly (1231715) | answered Jan 29 '09, 8:52 a.m.
ok - found the SDK now....

...but, if i call item.setCreator() i get a com.ibm.team.repository.common.internal.ImmutablePropertyException

is there a way to override this?

I'm sure Javadoc would help, but I can't find any...

permanent link
Balaji Krish (1.8k12) | answered Jan 29 '09, 10:45 a.m.
JAZZ DEVELOPER
When you fetch an item, we return an immutable copy of the item.

Get the working copy of the item before setting the new values.

Basic flow :
1. Get the item
2. Get the working copy of the item using item.getWorkingCopy
3. set the values
4. Save the item

--- Balaji
Jazz Server Team



ok - found the SDK now....

...but, if i call item.setCreator() i get a com.ibm.team.repository.common.internal.ImmutablePropertyException

is there a way to override this?

I'm sure Javadoc would help, but I can't find any...

permanent link
John Kelly (1231715) | answered Feb 03 '09, 5:45 a.m.
got it working now - thanks for the hints.

permanent link
Guowei Jim Hu (1.0k810353) | answered Feb 28 '09, 8:27 p.m.
What attribute id do you use for work item's Resolved By attributes?

I added the following to the mapping file:
attribute sourceId="resolutiondate" targetId="com.ibm.team.workitem.attribute.resolutiondate"
attribute sourceId="ResolvedBy" targetId="com.ibm.team.workitem.attribute.resolvedby"

and got Resolution Date work, but can't get the Resolved By imported.

permanent link
John Kelly (1231715) | answered Dec 08 '09, 8:51 a.m.
What attribute id do you use for work item's Resolved By attributes?

I added the following to the mapping file:
attribute sourceId="resolutiondate" targetId="com.ibm.team.workitem.attribute.resolutiondate"
attribute sourceId="ResolvedBy" targetId="com.ibm.team.workitem.attribute.resolvedby"

and got Resolution Date work, but can't get the Resolved By imported.


I've put the source of my application on my personal website blog at http://www.greenelk.co.uk/index.php/blogmenu/15-rtc-utility-to-move-workitems-from-one-user-to-another - hope it's of some help..

regards
John

Your answer


Register or 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.