How to extend workitem to store additional data consisting of many key/value pairs java api
so I have additional information that I want to link to or store with the defect work item
The additional information consists of the up to 10 different key/value pairs . i think it would look clumsy adding them as custom attributes but I want to store them and have them available to users for review and or be able to programmatically retrive them later in another part of my project . I also need to be able to store those key value pairs programmatically via the java api Is this possible ? May be using workitem extensions? Not sure how/where to begin Please advise Thanks |
2 answers
Is this a pre-defined data available? and is it constant throughout?
Thanks.
Comments
mark owusu-ansah
commented Mar 09 '13, 7:50 a.m.
Valli,
you can choose to display it in a
1. different tab (or) file attachment
2. Maintain the key-pairs in 1 workitem - and auto-link all new workitems of a type to that common item with the key-value pairs -> when users hover over the link, they can see the details
Not sure if this meets your requirement.
mark owusu-ansah
commented Mar 09 '13, 12:17 p.m.
Valli,
|
Ralph Schoon (63.3k●3●36●46)
| answered Mar 09 '13, 1:52 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
If you are on 4.x you should try to use a string list attribute. You can encode key and value and store it using the API.
Comments
mark owusu-ansah
commented Mar 09 '13, 1:59 p.m.
Yes, I am no 4.0.0.1 . Stringlist attribute? I have used enumeration but not stringlist . Will investigate . Up till now(your comments) ,, my best option looked like putting the various key/values on a separate tab , per earlier comments,
With encoding, I mean storing it as a string. You can usually do that. As URL, whatever. Serialized it. With respect to the presentation, you can put it on a separate tab and potentially make it read only in the UI. It is possible to add own value providers and representations. It is also possible to extend the storage service. I would advise against it.
mark owusu-ansah
commented Mar 09 '13, 4:36 p.m.
Ralph,
If you want to avoid one attribute for each key, use a string list and encode the entries for example as D4_FIRSTCLASSIFIER=<value> where <value> is the data to store. It is easy enough to get the value list of the attribute and manage the data in an extension or Plain Java Client.
mark owusu-ansah
commented Mar 11 '13, 1:54 p.m.
Ralph,
Mark, in 4.x you can define one attribute to contain a list of strings. The strings stored in the attribute are accessible as a list in Java. Each string can contain arbitrary strings. So you can stuff as many as you want in there. Since the value is not enough in your case you would store the identifier and the value in one string and you will have to split the string later into its parts, to be able to interpret it.
showing 5 of 6
show 1 more comments
|
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.