rtc api : add attributes and editor presentation elements
![]()
Hello to the forum members,
I defined couple of attributes and some related presentations for a work-item. I'd like to prepare some sort of setup script that will create these items. I'm digging into RTC SDK API in search for an API that will allow me to add attributes and editor presentation elements, currently with no luck. If you have a link to sample code that does that it would be great if you could add it here. Many thanks, Gidi |
One answer
![]()
Ralph Schoon (62.3k●3●36●43)
| answered Feb 27 '14, 2:45 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Feb 27 '14, 4:14 a.m.
This code adds the attribute to the project area, if it is not available
if (null == customString && fCreateAttributesIfMissing) { customString = workItemClient.createNewAttribute(fProjectArea, fCustomStringAttributeID, AttributeTypes.SMALL_STRING, IAttribute.FULL_TEXT_KIND_DEFAULT, monitor); customString.setDisplayName("Created String (" + fCustomStringAttributeID + ")"); customString = workItemClient.saveAttribute(customString, monitor); } if (!workItem.hasCustomAttribute(customString)) { // If not defined in the process template it has to be // manually created workItem.addCustomAttribute(customString); }Caveat of this approach was that the attribute was not available in the process XML as far as I remember. It was available for usage in the project, but did not show up in the configuration editor. I have not tried this for a very long time. All the code needed to create new attributes and editor presentations is available in the Eclipse client. Out of curiosity I have looked at the project area editor to find out more. However, it is so abstracted out and really complex, that I gave up trying, because I did not have the business justification to spend days on it. Comments I just checked and the attribute gets created on the work item and can be set and shows up in the custom tab in Eclipse. However, It never shows up in the project configuration XML.
One more finding: After the attribute was created, it does not show up in the listof attributes of the work item type, I created it at.
|
Comments
Some more information on this question:
If it was possible to export\import this part of the project area (process configuration) using repotools or a different tool, I could use this option instead of writing my own code. However, reading the mentioned below questions\work items, I understand it is not possible.
https://jazz.net/jazz/web/projects/Jazz%20Foundation#action=com.ibm.team.workitem.viewWorkItem&id=20094
https://jazz.net/forum/questions/24243/rtc-20-how-to-export-a-specific-project-area
https://jazz.net/forum/questions/122004/is-it-possible-to-take-a-snapshot-of-project-area-in-rtc