Setting priority within a participant
I'm sure this is really easy, but for the life of me, I can't get it to work.
I am in a Server-side participant for a WorkItemSave and I just need to set the value of the Priority built-in attribute. I have the workingCOpy, and I can do workingCopy.setPriority(iPriorityIdentifier); and then _service.saveWorkItem3(); but the setPriority takes an Identifier<IPriority> which I am struggling to get. Anybody have a snippet they can help me with? Susan |
Accepted answer
well, the priority is an enum, enums have ILiterals and these have identifiers.
from my dump workitem utility // this will throw exception if not enumeration IEnumeration<ILiteral> enumeration = (IEnumeration<ILiteral>) workItemCommon .resolveEnumeration(ia, monitor); if (enumeration != null) { 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) { Identifier i=literal.getIdentifier2(); <------ if (literal.getIdentifier2() .getStringIdentifier() .equalsIgnoreCase(iaval[1])) { Susan Hanson selected this answer as the correct answer
Comments
Susan Hanson
commented Aug 27 '14, 9:36 p.m.
Right, I have almost all of that already, but am missing the IAttributeHandle for Priority to pass in.
Susan Hanson
commented Aug 27 '14, 9:52 p.m.
nevermind .. duh
|
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.