Skip to main content
System StatusContact Support Agility Community

Creating Assets

When you create a new asset with the Java SDK, you need to specify the context of another asset that will be the parent. For example, if you create a new Story asset you can specify which Scope (project) it should be created in.

Prior to creating an asset in VersionOne, you must first instantiate a V1Connector and Services object:

V1Connector connector = V1Connector
    .withInstanceUrl("<Server Base URI>")
    .withUserAgentHeader("AppName", "1.0")
IServices services = new Services(connector);

Creating a New Asset

This example shows how to create a Story asset in the context of a Scope with ID 1012:

Oid projectId = services.getOid("Scope:0");
IAssetType storyType = services.getMeta().getAssetType("Story");
Asset newStory = services.createNew(storyType, projectId);
IAttributeDefinition nameAttribute = storyType.getAttributeDefinition("Name");
newStory.setAttributeValue(nameAttribute, "My New Story");;


/***** OUTPUT *****
My New Story