It's all about the answers!

Ask a question

Getting list of attachments into 'item list' attribute


Henry Armburg Jennings (13076) | asked Apr 12 '12, 6:50 a.m.
Hi,

I wish to populate a list of attachments of a workitem in a checkbox/radio button style so that users can select one or more attachments.

So I'm going to use an 'Item list' but the items you can add to this list only include project area/team area/category etc. How would I add my own custom item (i.e 'Attachment') so that it shows on this list.

Also, please feel free to tell me I'm going about this the wrong way!

Thanks,

Henry

4 answers



permanent link
Henry Armburg Jennings (13076) | answered Apr 17 '12, 5:32 p.m.
Hi Ralph,

Having thought about this, my ideal solution would be to use the 'HTTP Filtered Value Set Provider' and run an XPath expression on the URL https://localhost:9443/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/${xy.value}

where 'xy' is an attribute with a read-only value equal to the work item number.

But unfortunately ${xy.value} isn't available until version 3.5 M4 and I need it to work with version 3.0.1.1.

Anyway, just wanted to let you know for future reference (and if working with more recent versions!).

Thanks for your help,

Henry

permanent link
Ralph Schoon (63.1k33645) | answered Apr 17 '12, 11:36 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi Henry,

if you can use the value providers, it would certainly be easier. Creating attribute presentations seems to be a lot of work (did not do it myself), especially if you have to do them for the Web and the Eclipse client as well.

The issue with the value providers however is, that very few API is actually exposed in the scripts. I don't think you can access attachments from the scripts. So it might be impossible. If you can provide them vial HTTP it might be doable.

I haven't looked if you can use the presentations available against some other extension, as I understand you are building.

Sorry, but the area is too broad to do all the interesting stuff!

permanent link
Henry Armburg Jennings (13076) | answered Apr 17 '12, 11:20 a.m.
Hi Ralph,

I wouldn't actually need it to be of type 'attachment,' just of string type as I was planning on populating this list separately (through another plugin I'm doing) so really they just need to REPRESENT the attachments.

I've looked at your suggestion though thank you but it seems very involved. I've also come across this:

https://jazz.net/wiki/bin/view/Main/DataSourceValueSetProviders

Do you think it would be easier to use this? (I have RTC v 3.0.1.1.)

Thanks

permanent link
Ralph Schoon (63.1k33645) | answered Apr 17 '12, 9:51 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Henry,

I think the editor presentations you would like are not able to handle attachments. I don't think you can create a new attribute of type attachment either. The checkbox would be impractical if the number of attachments grow.

You could however try to add your own attribute representation: https://jazz.net/wiki/bin/view/Main/ContributingAttributePresentationsV2

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.