Skip to main content
System StatusContact Support
VersionOne Community

Asset Creation Examples

This endpoint was introduced in 18.0, Winter 2018. Please view the About VersionOne information from the orange help icon in the menu bar to see if you are on this release or later.

Create a Single Story 

curl -i -X POST \
   -H "Content-Type:application/json" \
   -H "Authorization:Bearer 1.BO9wxGpDbI2Oh2OPbhb7wW4ghj0=" \
   -d \
'{
  "Scope": "System (All Projects)",
  "AssetType": "Story",
  "Name": "Story"
}' \
 'https://yourVersionOneInstance/api/asset'

Create Multiple  Stories

curl -i -X POST \
   -H "Content-Type:application/json" \
   -H "Authorization:Bearer 1.BO9wxGpDbI2Oh2OPbhb7wW4ghj0=" \
   -d \
'[{
  "Scope": "System (All Projects)",
  "AssetType": "Story",
  "Name": "Story A"
},
{
  "Scope": "System (All Projects)",
  "AssetType": "Story",
  "Name": "Story B"
}
]' \
 'https://yourVersionOneInstance/api/asset'

Create mulitple types of assets

curl -i -X POST \
   -H "Content-Type:application/json" \
   -H "Authorization:Bearer 1.BO9wxGpDbI2Oh2OPbhb7wW4ghj0=" \
   -d \
'[{
  "Scope": "System (All Projects)",
  "AssetType": "Story",
  "Name": "Story A"
},
{
  "Scope": "System (All Projects)",
  "AssetType": "Defect",
  "Name": "Defect A"
}
]' \
 'https://yourVersionOneInstance/api/asset'

 

Create multiple Stories and attach Tests and Tasks to each

curl -i -X POST \
   -H "Content-Type:application/json" \
   -H "Authorization:Bearer 1.BO9wxGpDbI2Oh2OPbhb7wW4ghj0=" \
   -d \
'[
  {
    "Scope": "System (All Projects)",
    "AssetType": "Story",
    "Name": "Story-1",
    "Children": [
      {
        "AssetType": "Test",
        "Name": "Test-1 in Story-1"
      },
      {
        "AssetType": "Task",
        "Name": "Task-1 in Story-1"
      },
      {
        "AssetType": "Test",
        "Name": "Test-2 in Story-1"
      },
      {
        "AssetType": "Task",
        "Name": "Task-2 in Story-1"
      }
    ]
  },
  {
    "Scope": "System (All Projects)",
    "AssetType": "Story",
    "Name": "Story-2",
    "Children": [
      {
        "AssetType": "Test",
        "Name": "Test-1 in Story-2"
      },
      {
        "AssetType": "Task",
        "Name": "Task-1 in Story-2"
      },
      {
        "AssetType": "Test",
        "Name": "Test-2 in Story-2"
      },
      {
        "AssetType": "Task",
        "Name": "Task-2 in Story-2"
      }
    ]
  },
  {
    "Scope": "System (All Projects)",
    "AssetType": "Story",
    "Name": "Story-3",
    "Children": [
      {
        "AssetType": "Test",
        "Name": "Test-1 in Story-3"
      },
      {
        "AssetType": "Task",
        "Name": "Task-1 in Story-3"
      },
      {
        "AssetType": "Test",
        "Name": "Test-2 in Story-3"
      },
      {
        "AssetType": "Task",
        "Name": "Task-2 in Story-3"
      }
    ]
  }
]' \

Create Story and attach to existing Epic 

curl -i -X POST \
   -H "Content-Type:application/json" \
   -H "Authorization:Bearer 1.BO9wxGpDbI2Oh2OPbhb7wW4ghj0=" \
   -d \
'[{
  "from" : "Epic:4622",
  "update" : { 
    "Subs" : {
      "add" :[ {
        "AssetType" : "Story",
          "Name" : "Story-1"
      }]
    }
  }
}]' \
 'https://yourVersionOneInstance/api/asset'

Create a new Story and use an existing Story then attach both to an Epic

curl -i -X POST \
   -H "Content-Type:application/json" \
   -H "Authorization:Bearer 1.BO9wxGpDbI2Oh2OPbhb7wW4ghj0=" \
   -d \
'[{
  "from" : "Epic:4622",
  "update" : { 
    "Subs" : {
      "add" :[ 
      {
          "AssetType" : "Story",
          "Name" : "Story-1"
      },
          "Story:1234"
      ]
    }
  }
}]' \
 'https://yourVersionOneInstance/api/asset'

Associate a Story to an Epic using a Subquery

curl -i -X POST \
   -H "Content-Type:application/json" \
   -H "Authorization:Bearer 1.BO9wxGpDbI2Oh2OPbhb7wW4ghj0=" \
   -d \
'[{
  "from" : "Epic:4622",
  "update" : { 
    "Subs" : {
      "add" : {
        "from": "Story",
        "filter" : ["ID='Story:1227'"]
      }
    }
  }
}]' \
 'https://yourVersionOneInstance/api/asset'

 

  • Was this article helpful?