How to get custom attribute of type enumeration server side
Hello All,
Can some one suggest how to get (read) the story point enumeration value to make use in a server side plug-in ? Below code works for standard attribute like duration, but not for enumeration type. ------------
private long getDuration(IWorkItem child, IAttribute attribute, IProgressMonitor monitor) throws TeamRepositoryException {
-------------- Thank you. |
Accepted answer
Ralph Schoon (63.7k●3●36●48)
| answered Jul 31 '15, 6:08 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Jul 31 '15, 6:09 a.m.
See https://rsjazz.wordpress.com/2012/08/20/manipulationg-work-item-enumeration-values/
More details: private String calculateEnumerationLiteralAsString(Object value, IAttribute attribute) throws TeamRepositoryException { if (value == null) { return CONSTANT_NO_VALUE; } if (!(value instanceof Identifier<?>)) { return "Value not an enumeration literal"; } IEnumeration<? extends ILiteral> enumeration = getWorkItemCommon() .resolveEnumeration(attribute, getMonitor()); @SuppressWarnings("unchecked") Identifier<? extends ILiteral> currentIdentifier = (Identifier<? extends ILiteral>) value; ILiteral literal = enumeration .findEnumerationLiteral(currentIdentifier); return literal.getName(); } Ratheesh Madathil selected this answer as the correct answer
Comments
Ratheesh Madathil
commented Aug 04 '15, 3:19 a.m.
Thank you Ralph for your answer. In fact we had refereed already to the link you mentioned, but not successful.
Ratheesh Madathil
commented Aug 14 '15, 10:19 a.m.
Thank you Ralph, that hint worked..
|
One other answer
Ralph Schoon (63.7k●3●36●48)
| answered Aug 04 '15, 4:07 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Please carefully read https://jazz.net/forum/questions/203755/how-should-i-ask-a-question-in-the-forum-if-i-want-to-receive-useful-answers
The error you show is not an error in the code. It is an error in setting up the plugin and deploying it. Before you even get to this point, you should have already followed https://rsjazz.wordpress.com/2013/02/28/setting-up-rational-team-concert-for-api-development/ and debugged your code on Jetty. Once the debugging works, it is easy enough to very fy the code works and if it does, then you deploy on the server and know that the code works and your problems are due to deployment problems. Why do you run two threads with the same question? Can't you coordinate with your colleague? Comments
Ratheesh Madathil
commented Aug 04 '15, 4:20 a.m.
ok, got it.
What error do you get with Jetty?
|
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.