Help tagging a build
![]()
Hi,
I want to apply a tag to specific builds. I am able to get the IBuildResult handle but when I try to do setTags(), I get an exception: IBuildResult buildResult = (IBuildResult) result; if(buildResult.getLabel().equals("20111123-1018")) { buildResult.setTags("steve-test"); Caused by: com.ibm.team.repository.common.internal.ImmutablePropertyException at com.ibm.team.repository.common.internal.util.ItemUtil$ProtectAdapter.notifyChanged(ItemUtil.java:2026) at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:380) at com.ibm.team.build.internal.common.model.impl.BuildResultImpl.setTags(BuildResultImpl.java:1021) Is there a different way I should be doing this? Thanks, -Steve |
2 answers
![]()
Duh. Needed to get a workingCopy of the buildResult. Now its fine.
For sake of sharing ... IBuildResult buildResult = (IBuildResult) buildResult.getWorkingCopy(); String existing_tags = buildResult.getTags(); buildResult.setTags("" + existing_tags + " " + tag); buildClient.save(buildResult, monitor); -Steve |
![]()
Yup, looks good, except that the tags should be comma-separated.
|
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.