Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

0 votes



2 answers

Permanent link
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

0 votes


Permanent link
Yup, looks good, except that the tags should be comma-separated.

0 votes

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,952

Question asked: Nov 23 '11, 11:18 a.m.

Question was seen: 7,776 times

Last updated: Nov 23 '11, 11:18 a.m.

Confirmation Cancel Confirm