Attributes synchronization with Java ? Possible ?
Hi,
In my company, we need to work with more than one hundred projects and regularly, we have to modify custom attributes in all projects (they have the same process template). In article https://jazz.net/library/article/529/ is mentionned the synchronization but we need to do it manually and it takes many time ... Could we do it with the API (Java) ? Thanks for your answer |
4 answers
Ralph Schoon (63.5k●3●36●46)
| answered Apr 23 '12, 12:20 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi,
I am pretty sure that would be possible, since the synchronize attributes is done in the Eclipse client. I am not sure how complex it would be. Essential it would have to go through all work items (e.g. using a query) then find the custom attributes for the type and then create the attribute for the work item if it does not have it. It is possible to create custom attributes using the API. You can do that even if they are not defined in the process template. I think they would not show up in the process template. At least I have seen that in the past. What I haven't tried yet and thus an mot sure of is how to create then in the process description, so that they show up as custom attributes in the configuration. Since the Eclipse Client uses the API to do this, I would assume it is possible. Have you looked into the capability of sharing a process from a project? Maybe that can reduce your effort? |
Hi,
Maybe I have to simply look this way : workItemClient.updateWorkItemType(workItem, type, type, monitor); I have to test ... |
that changes the workitem type from Defect to Story or whatever
|
Ralph Schoon (63.5k●3●36●46)
| answered May 29 '12, 3:42 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
The code can be found in
com.ibm.team.workitem.rcp.ui.internal.actions.SynchronizeAttributesAction And it is in fact documented that
Is used like this:
So the ley is to run updateWorkItemType() with the original type, which adds attributes if they are not already there. |
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.