Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Java API - ServerSide : Get priority name

 
Hello,

Do you know how get the label (name) of priority with the ID ?

"Identifier<IPriority> priorityValue = currentWorkItem.getPriority();"

Thanks,
Antoine

0 votes


Accepted answer

Permanent link
from my pgm here, post 2,
https://jazz.net/forum/questions/94776/assertionfailedexception-problem-with-getting-the-values-of-attributes

                                String[] iaval = ia
                                        .getValue(auditableClient, workItem,
                                                monitor).toString().split(":");
                                if (iaval.length > 1 && iaval[1] != null)
                                {
                                    List<ILiteral> enumerationLiterals = enumeration
                                            .getEnumerationLiterals();
                                    for (ILiteral literal : enumerationLiterals)
                                    {
                                        if (literal.getIdentifier2()
                                                .getStringIdentifier()
                                                .equalsIgnoreCase(iaval[1]))
                                        {
                                            System.out
                                            .println("\t\t\t\t --> attribute id="
                                                    + ia.getIdentifier()
                                                    + ", type"
                                                    + "="
                                                    + ia.getAttributeType()
                                                    + " literal="
                                                    + literal
                                                    .getIdentifier2()
                                                    .getStringIdentifier()
                                                    + " literal name="
                                                    + literal.getName());
                                            break;
                                        }
                                    }
                                }
Antoine LELEU selected this answer as the correct answer

1 vote


One other answer

Permanent link
 
Thanks,

i could fix my problem with your sample.

Antoine

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,954

Question asked: Feb 14 '14, 7:37 a.m.

Question was seen: 4,029 times

Last updated: Feb 14 '14, 11:49 a.m.

Confirmation Cancel Confirm