getting Validation error "PropertyConstraintException:Duplicate item references are not allowed: customAttributes " on saving workItem -Server side plugin
I am working on a RTC server-side plugin which basically updates the value of a custom attribute in its parent’s work-item. It works fine till one level of hierarchy i.e if a work-item has only parent and fails while updating its grand parent.
It fails with the following exception :
//exception stack
2016-12-04 22:12:19,246 [http-bio-9443-exec-5 @@ 22:12 myadmin <com.ibm.team.repository.transport.client.RemoteTeamService spnego-enabled@127.0.0.1> /ccm/service/com.ibm.team.workitem.common.internal.IWorkItemRepositoryService] ERROR com.ibm.team.process.common - Validation errors for item: type = WorkItem, itemId = [UUID _ISui0LobEeaQdoRl3qgW5A]
Duplicate item references are not allowed: customAttributes
com.ibm.team.repository.common.validation.PropertyConstraintException: Validation errors for item: type = WorkItem, itemId = [UUID _ISui0LobEeaQdoRl3qgW5A]
Duplicate item references are not allowed: customAttributes
at com.ibm.team.repository.service.internal.RdbRepositoryDataMediator.failIfNecessary(RdbRepositoryDataMediator.java:467)
at com.ibm.team.repository.service.internal.RdbRepositoryDataMediator.validateItem(RdbRepositoryDataMediator.java:416)
at com.ibm.team.repository.service.internal.RdbRepositoryDataMediator.validateItemWithPossibleRewrites(RdbRepositoryDataMediator.java:436)
at com.ibm.team.repository.service.internal.RdbRepositoryDataMediator.createImmutablePersistentCopy(RdbRepositoryDataMediator.java:1688)
at com.ibm.team.repository.service.internal.RdbRepositoryDataMediator.createImmutablePersistentCopyForSave(RdbRepositoryDataMediator.java:1651)
at com.ibm.team.repository.service.internal.RdbRepositoryDataMediator.saveAuditable(RdbRepositoryDataMediator.java:890)
…
.
Eg:
I have task WI whose parent is Feature and grand parent is Story .I have created three custom attributes mapped to each of these WI Types.
On save of task WI ,if the value of custom attribute has changed my participant in subject is trying to update another custom attribute of Feature which is successful but fails in updating the custom attribute of Story with the above mentioned exception .
I have followed the https://rsjazz.wordpress.com/2012/07/31/rtc-update-parent-duration-estimation-and-effort-participant/ example and trying to update the custom attributes of the parent work items in the hierarchy.
Does any one can help why the exception occurs and how to resolve it ?
Thanks for the help in advance ..
It fails with the following exception :
//exception stack
2016-12-04 22:12:19,246 [http-bio-9443-exec-5 @@ 22:12 myadmin <com.ibm.team.repository.transport.client.RemoteTeamService spnego-enabled@127.0.0.1> /ccm/service/com.ibm.team.workitem.common.internal.IWorkItemRepositoryService] ERROR com.ibm.team.process.common - Validation errors for item: type = WorkItem, itemId = [UUID _ISui0LobEeaQdoRl3qgW5A]
Duplicate item references are not allowed: customAttributes
com.ibm.team.repository.common.validation.PropertyConstraintException: Validation errors for item: type = WorkItem, itemId = [UUID _ISui0LobEeaQdoRl3qgW5A]
Duplicate item references are not allowed: customAttributes
at com.ibm.team.repository.service.internal.RdbRepositoryDataMediator.failIfNecessary(RdbRepositoryDataMediator.java:467)
at com.ibm.team.repository.service.internal.RdbRepositoryDataMediator.validateItem(RdbRepositoryDataMediator.java:416)
at com.ibm.team.repository.service.internal.RdbRepositoryDataMediator.validateItemWithPossibleRewrites(RdbRepositoryDataMediator.java:436)
at com.ibm.team.repository.service.internal.RdbRepositoryDataMediator.createImmutablePersistentCopy(RdbRepositoryDataMediator.java:1688)
at com.ibm.team.repository.service.internal.RdbRepositoryDataMediator.createImmutablePersistentCopyForSave(RdbRepositoryDataMediator.java:1651)
at com.ibm.team.repository.service.internal.RdbRepositoryDataMediator.saveAuditable(RdbRepositoryDataMediator.java:890)
…
.
Eg:
I have task WI whose parent is Feature and grand parent is Story .I have created three custom attributes mapped to each of these WI Types.
On save of task WI ,if the value of custom attribute has changed my participant in subject is trying to update another custom attribute of Feature which is successful but fails in updating the custom attribute of Story with the above mentioned exception .
I have followed the https://rsjazz.wordpress.com/2012/07/31/rtc-update-parent-duration-estimation-and-effort-participant/ example and trying to update the custom attributes of the parent work items in the hierarchy.
Does any one can help why the exception occurs and how to resolve it ?
Thanks for the help in advance ..
One answer
You apparently do somethign with the API that you better should not. Not sure how you could introduce duplicate references and what that actually is. I have never had that problem.
- Validation errors for item: type = WorkItem, itemId = [UUID _ISui0LobEeaQdoRl3qgW5A]
Duplicate item references are not allowed: customAttributes
com.ibm.team.repository.common.validation.PropertyConstraintException: Validation errors for item: type = WorkItem, itemId = [UUID _ISui0LobEeaQdoRl3qgW5A]
Duplicate item references are not allowed: customAttributes
Duplicate item references are not allowed: customAttributes
com.ibm.team.repository.common.validation.PropertyConstraintException: Validation errors for item: type = WorkItem, itemId = [UUID _ISui0LobEeaQdoRl3qgW5A]
Duplicate item references are not allowed: customAttributes
Maybe you try to add the same attribute on different work items. No Idea.