It's all about the answers!

Ask a question

Access an attribute label (set in the editor) from a java extension


Philipp H (53514) | asked Aug 23 '16, 9:18 a.m.
 Hi everybody,

I wrote a java server extension that checks if a linktype/reference field is filled.
Now I want to send the user an error message and would like to make it say
"Field is not set".
But how can I access the label of the field? (label set in the editor)


Thanks!

(Oh and also this will be my last question, so thank you all for your support, you were a giant help. Especially you Ralph :) )

2 answers



permanent link
Ralph Schoon (63.1k33645) | answered Aug 23 '16, 9:32 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
I would try com.ibm.team.workitem.common.model.IAttribute.getDisplayName()

Good luck Philipp.

Comments
Philipp H commented Aug 23 '16, 9:56 a.m.

 Ok that works,

would you know the equivalent for Linktypes?


Philipp H commented Aug 23 '16, 9:57 a.m.

Because com.ibm.team.links.common.registry.IEndPointDescriptor.getDisplayName() only gives me the name that's in the linktype plugin/extension and not the label from the editor


1
Ralph Schoon commented Aug 23 '16, 10:10 a.m. | edited Aug 23 '16, 10:11 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Sorry, no idea then. I tried the same path, but don't have a testbed.


permanent link
Philipp H (53514) | answered Aug 24 '16, 6:03 a.m.
I wrote a file with the ids and their aliases and put it in a HashMap<id,alias>.
That works too.


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.