We have seen how to add versions as fix for versions or affected versions on an issue. But how do we create those versions using REST? In this recipe, we will see how to create versions in a project and manage them using JRJC!
As usual, create a JIRA REST client as mentioned in the Writing Java client for REST API recipe.
A new version can be added into a project as follows:
Create a
VersionInput
object with the necessary details:VersionInputversionInput = new VersionInput ("DEMO", "JRJC", "Test", new DateTime(), false, false);
Use the
createVersion
method onVersionRestClient
:Promise<Version> version = jiraRestClient.getVersionRestClient().createVersion(versionInput);
Once a version is created, you can retrieve it any time using the version URI:
Promise<Version> version = jiraRestClient.getVersionRestClient().getVersion(versionURI);
Given a version, you can update it by sending a new VersionInput
object...