Asset Creation Examples
This article provides examples for Asset creation.
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://yourAgilityInstance/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://yourAgilityInstance/api/asset'
Create multiple 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://yourAgilityInstance/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://yourAgilityInstance/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://yourAgilityInstance/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'