Managing versions via SOAP
We have seen how to add versions as a fix for versions or affected versions on an issue. But how do we create those versions using SOAP? In this recipe, we will see how to create versions in a project and manage them!
Getting ready
As usual, create the SOAP client.
How to do it...
A new version can be added into a project as follows:
Create a
RemoteVersion
object with the necessary details:RemoteVersion remoteVersion = new RemoteVersion(); remoteVersion.setName("Test Release"); remoteVersion.setReleaseDate(new GregorianCalendar(2011, Calendar.MAY, 10)); remoteVersion.setSequence(5L);
Here, the
sequence
defines the order in which the version will appear in the version list.Create the version using
addVersion
method:RemoteVersion createdVersion = jiraSoapService.addVersion(authToken, "TST", remoteVersion); System.out.println("Created version with id:"+createdVersion.getId());
where
TST
is the project key in which the new version is created.
Once a version is created, you...