Updating Nested EntityState for UserStories

39 views
Skip to first unread message

Dave Anderson

unread,
Nov 20, 2016, 11:29:40 AM11/20/16
to DevTargetProcess
Hi,

I'd appreciate some help transitioning a user story from one nested state to another 

Here are the states I think I'm dealing with. Got from:
https://ncarb.tpondemand.com/api/v1/EntityStates?where=(Workflow.Process.Id eq 4) and (Workflow.EntityType.Id eq 4) and (Workflow.Name eq 'IS Team Workflow') and (ParentEntityState.Id eq 250)
{
  "Items": [
    {
      "ResourceType": "EntityState",
      "Id": 269,
      "Name": "In Testing",
      "IsInitial": false,
      "IsFinal": false,
      "IsPlanned": false,
      "IsCommentRequired": false,
      "NumericPriority": 4,
      "EntityType": {
        "ResourceType": "EntityType",
        "Id": 4,
        "Name": "UserStory"
      },
      "Role": null,
      "Process": null,
      "ParentEntityState": {
        "ResourceType": "EntityState",
        "Id": 250,
        "Name": "Review",
        "NumericPriority": 1.5
      },
      "Workflow": {
        "ResourceType": "Workflow",
        "Id": 51,
        "Name": "IS Team Workflow"
      }
    },
    {
      "ResourceType": "EntityState",
      "Id": 270,
      "Name": "Ready for Signoff",
      "IsInitial": false,
      "IsFinal": false,
      "IsPlanned": false,
      "IsCommentRequired": false,
      "NumericPriority": 5,
      "EntityType": {
        "ResourceType": "EntityType",
        "Id": 4,
        "Name": "UserStory"
      },
      "Role": null,
      "Process": null,
      "ParentEntityState": {
        "ResourceType": "EntityState",
        "Id": 250,
        "Name": "Review",
        "NumericPriority": 1.5
      },
      "Workflow": {
        "ResourceType": "Workflow",
        "Id": 51,
        "Name": "IS Team Workflow"
      }
    }
  ]
}


I can transition from "In Progress" to "In Testing" via
{Id:1000, EntityState: {Id:250}}
using the ParentState.Id

I'm not sure how to indicate "Ready for Sign-off
when I try
{Id:1000, EntityState: {Id:270}}
using the child Id, the error I receive is:

Transition from 165 In Progress to 

{"Status":"Forbidden","Message":"Cannot create nested parent resource of EntityState type (property EntityState). References to already existed parent resources are acceptable only.","Type":"Presentational","Details":{"Items":[{"Type":"Simple","Message":{"Token":"Cannot create nested parent resource of {typeName} type (property {propertyName}). References to already existed parent resources are acceptable only.","Data":{"typeName":"EntityState","propertyName":"EntityState"},"Value":"Cannot create nested parent resource of EntityState type (property EntityState). References to already existed parent resources are acceptable only."}}]},"ErrorId":"e0ef6c93-267b-4106-af01-05d535c1eaf9"}


What's the right way to transition to from one child to another: from In Testing to Ready for Signoff?

Regards,
Dave
Screenshot 2016-11-20 10.55.38.png

tsar...@targetprocess.com

unread,
Nov 21, 2016, 4:18:29 AM11/21/16
to DevTargetProcess
Hello!

Sometimes you can cheat and look at XHRs in browser during changing state to one you need :)

POST tp_url/api/v1/userStories.asmx/88?skip=0&take=999&resultInclude=[id,assignedTeams[id,entityState[id]]]  
{  
   
"id":88,              // Entity id.
   
"assignedTeams":[     // Assignment (User story, Bug, etc.) to Team link.
     
{  
         
"id":5,         // TeamAssignment id (tp_url/api/v1/TeamAssignments).
         
"team":{          
           
"id":66      // Team id assigned to entity (tp_url/api/v1/Teams).
         
},
         
"entityState":{  
           
"id":270     // New entity state.
         
}
     
}
   
]
}

Hope, this helps.
Message has been deleted

Dave Anderson

unread,
Nov 21, 2016, 9:18:40 PM11/21/16
to DevTargetProcess, tsar...@targetprocess.com
It helps. Thank you.
Reply all
Reply to author
Forward
0 new messages