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

Changing a build definition with the Java API

Hi. I'm writing a program to change a build definition trying to change a build def property (buildforge to jenkins).
Can anyone help with the error message (state id and item id)
Thanks.
regards
Sola

----------------------

buildClient = (ITeamBuildClient) this.teamRepository.getClientLibrary(ITeamBuildClient.class);

IBuildDefinition bd = buildClient.getBuildDefinition(bdName, rtc.getMonitor());
IBuildDefinition wc = (IBuildDefinition) bd.getWorkingCopy();
wc.setProperty("com.ibm.team.build.internal.template.id", "com.ibm.rational.connector.hudson.ui.buildDefinitionTemplate");
bd = buildClient.getBuildClient().save(bd, rtc.getMonitor());

throwing an exception for some missing values:

java.lang.IllegalArgumentException: Item id and State id must not be null

    at com.ibm.team.repository.service.internal.RepositoryItemService.fetchState(RepositoryItemService.java:695)
    at sun.reflect.GeneratedMethodAccessor430.invoke(null)



0 votes



One answer

Permanent link
Sorry folks...spotted my mistake. sent the bdef instead of working copy to save.

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,930

Question asked: Feb 24 '15, 12:54 p.m.

Question was seen: 3,248 times

Last updated: Feb 24 '15, 1:05 p.m.

Confirmation Cancel Confirm