Create several StoryStatus Assets followed by new Stories that use them
Suppose you have a TeamRoom and that when you go to Customize the Storyboard you see the following, pesky, boring Status values available:
But, what you really want are statuses coming from the hipster agile tracking tool that your company used for a while and has outgrown:
- On the Shelf
- Gettin' There
- Try'n to Break
- Fear Review
- Done Done
And, you want to import the items from said hipster agile tool into your TeamRoom with these statuses.
Script
# Inactivate current statuses
from: StoryStatus
execute: Inactivate
---
AssetType: StoryStatus
Name: On the Shelf
RollupState: 0
---
AssetType: StoryStatus
Name: Gettin' There
RollupState: 64
---
AssetType: StoryStatus
Name: Fear Review
RollupState: 64
---
AssetType: StoryStatus
Name: Try'n to Break
RollupState: 64
---
AssetType: StoryStatus
Name: Done Done
RollupState: 128
# Create new stories referencing the statuses we just made
---
AssetType: Story
Scope: Scope:0
Name: First
Timebox: Timebox:1007
Status: Done Done
---
AssetType: Story
Scope: Scope:0
Name: Second
Timebox: Timebox:1007
Status: Fear Review
---
AssetType: Story
Scope: Scope:0
Name: Third
Timebox: Timebox:1007
Status: Try'n to Break
---
AssetType: Story
Scope: Scope:0
Name: Fourth
Timebox: Timebox:1007
Status: Gettin' There
---
AssetType: Story
Scope: Scope:0
Name: Sixth
Timebox: Timebox:1007
Status: On the Shelf
You can run it in bash with cURL like this:
curl -i -X POST \
-H "Content-Type:text/yaml" \
-H "Authorization:Basic YWRtaW46YWRtaW4=" \
-d \
'# Inactivate current statuses
from: StoryStatus
execute: Inactivate
---
AssetType: StoryStatus
Name: On the Shelf
RollupState: 0
---
AssetType: StoryStatus
Name: Gettin\'' There
RollupState: 64
---
AssetType: StoryStatus
Name: Fear Review
RollupState: 64
---
AssetType: StoryStatus
Name: Try\''n to Break
RollupState: 64
---
AssetType: StoryStatus
Name: Done Done
RollupState: 128
# Create new stories referencing the statuses we just made
---
AssetType: Story
Scope: Scope:0
Name: First
Timebox: Timebox:1007
Status: Done Done
---
AssetType: Story
Scope: Scope:0
Name: Second
Timebox: Timebox:1007
Status: Fear Review
---
AssetType: Story
Scope: Scope:0
Name: Third
Timebox: Timebox:1007
Status: Try\''n to Break
---
AssetType: Story
Scope: Scope:0
Name: Fourth
Timebox: Timebox:1007
Status: Gettin\'' There
---
AssetType: Story
Scope: Scope:0
Name: Sixth
Timebox: Timebox:1007
Status: On the Shelf' \
'http://localhost/VersionOne.Web/api/asset'
Result
Your Customize Storyboard screen should now look like this:
And, more importantly, your Storyboard itself should have your new Stories in the correct states!
Cleanup
If you want to reset your instance back to the original statuses and delete the ones you just made, it's pretty easy. Here's your script to do this:
from: StoryStatus
filter:
- Name="On the Shelf","Gettin'' There","Fear Review","Try''n to Break","Done Done"
execute: Delete
---
from: StoryStatus
filter:
- Name!="On the Shelf","Gettin'' There","Fear Review","Try''n to Break","Done Done"
execute: Activate
With cURL:
curl -i -X POST \
-H "Content-Type:text/yaml" \
-H "Authorization:Basic YWRtaW46YWRtaW4=" \
-d \
'from: StoryStatus
filter:
- Name="On the Shelf","Gettin\''\'' There","Fear Review","Try\''\''n to Break","Done Done"
execute: Delete
---
from: StoryStatus
filter:
- Name!="On the Shelf","Gettin\''\'' There","Fear Review","Try\''\''n to Break","Done Done"
execute: Activate' \
'http://localhost/VersionOne.Web/api/asset'
Result
Your Storyboard should now look like this:
Your Stories will all still be there, but since you killed their statuses, you'll have to drag them to where you want in the reactivated original statuses.
However, you could of course incorporate the modifications in your script, but you need to use Status.Name
instead of just Status
because of the way querying resolution works. Here's an example:
# Reactivate the default statuses
from: StoryStatus
filter:
- Name!="On the Shelf","Gettin'' There","Fear Review","Try''n to Break","Done Done"
execute: Activate
# Map story status back to the default statuses
---
from: Story
where:
Status.Name: On the Shelf
update:
Status: Future
---
from: Story
where:
Status.Name: Gettin' There
update:
Status: In Progress
---
from: Story
where:
Status.Name: Try'n to Break
update:
Status: In Progress
---
from: Story
where:
Status.Name: Fear Review
update:
Status: Done
---
from: Story
where:
Status.Name: Done Done
update:
Status: Accepted
# Delete the hipster statuses
---
from: StoryStatus
filter:
- Name="On the Shelf","Gettin'' There","Fear Review","Try''n to Break","Done Done"
execute: Delete
Thanks to Pavel for all his help on figuring out this script, and throughout the week, especially the idea of using the single /api/asset
endpoint instead of sub-routes, which allows us to do these heterogeneous scripts like above!