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 (61.8k●3●36●43)
| 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 ![]() FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Cindy, please accept the answer then. (The check mark underneath the vote down).
|