Issues programatically creating approval records
Here is the code snippet:
IApprovals approvals= workItem.getApprovals(); approvals.createDescriptor(WorkItemApprovals.VERIFICATION_TYPE.getIdentifier(), "Verification Record"); IApproval approval= approvals.createApproval(descriptor, reviewer); approvals.add(approval); I am getting the following error on the createDescriptor line. com.ibm.team.repository.common.internal.ImmutablePropertyException From my research so far, that exception usually can be fixed by using the workItemCopy. However, approvals and Iapprovals doesn't like workitemcopy. Any ideas on how to resolve this issue? Thx |
Accepted answer
Ralph Schoon (63.3k●3●36●46)
| answered Oct 01 '12, 6:28 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Cindy, approvals do like working copies, as far as I can tell. The example code here should work for you: http://rsjazz.wordpress.com/2012/10/01/adding-approvals-to-work-items-using-the-plain-java-client-libraries/
You can use the active piece with a WorkItemOperation as well with your own workingcopy code. Cindy Luk selected this answer as the correct answer
|
One other answer
Thanks for the information. I now have working code.
It turns out my issue was having an incorrect import statement. The correct imports are as follows: import com.ibm.team.workitem.common.model.IApproval; import com.ibm.team.workitem.common.model.IApprovalDescriptor; The incorrect import is this: import com.ibm.team.workitem.common.template.IWorkItemDescriptor.IApproval; Comments
Ralph Schoon
commented Oct 02 '12, 3:49 p.m.
| edited Oct 02 '12, 3:49 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Cindy, please accept the answer then. (The check mark underneath the vote down).
|
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.