Assign or un-assign users on a case
Users are assigned to Action Management Cases via one or more configured Roles. Case Roles are managed in the Action Management application as part of Program Setup. A user can be assigned to one or more roles on a case.
Get available roles
To get the role definitions for a hub, query the GET Roles endpoint with the hub ID.
GET https://<host>/v1/actionmanagement/hubs/6435/roles
Accept: application/json
Authorization: Bearer <access_token>
{
"itemType" : "Role",
"totalCount" : 2,
"itemCount" : 2,
"items" : [
{
"id" : 3456,
"name" : "Case Manager",
"lastUpdated" : "2021-06-04 13:51:04.967-00:00",
"links" : {}
},
{
"id" : 3457,
"name" : "Watcher",
"lastUpdated" : "2021-06-04 13:51:04.975-00:00",
"links" : {}
}
]
}
Get available users
An Action Management program is linked to an End User List that exists on the same hub. To get a list of available users, query the Get End Users Query endpoint on the Hubs API with the hub ID and user list ID. Any active user on the Action Management program’s user list is eligible to be assigned to a case role.
POST https://<host>/v1/hubs/6435/enduserlists/201/users/query
{
"isActive" : true,
"sortBy" : "UserId",
"top" : 100,
"skip" : 0
}
Accept: application/json
Authorization: Bearer <access_token>
{
"itemType" : "EndUser",
"itemCount" : 2,
"totalCount" : 2,
"items" : [ {
"id" : 8790,
"firstName" : "first name 1",
"lastName" : "last name 1",
"userName" : "exampleUser8790",
"email" : "exampleUser8790@example.com",
"language" : 9,
"isActive" : true,
"links" : { }
},
{
"id" : 8791,
"firstName" : "first name 2",
"lastName" : "last name 2",
"userName" : "exampleUser8791",
"email" : "exampleUser8791@example.com",
"language" : 9,
"isActive" : true,
"comment" : "this user has a comment",
"links" : { }
}
],
"links" : {
"item" : "<host>/v1/hubs/6435/enduser/8790",
"item" : "<host>/v1/hubs/6435/enduser/8791"
}
}
Adding a user to a case role
To start, get an existing case via the Get Case endpoint.
GET https://<host>/v1/actionmanagement/hubs/6435/cases/2009631
Accept: application/json
Authorization: Bearer <access_token>
{
"id" : 2009631,
"name" : "Example case",
"workflowId" : 3536,
"cost" : 250,
"triggerId" : 7315,
"triggerName" : "Example trigger",
"dateCreated" : "2021-10-01T00:00:00-07:00",
"dateModified" : "2021-10-04T00:00:00-07:00",
"listValues" : [ {
"listId" : 23,
"id" : 987,
"name" : "In Progress",
"type" : "status",
"isOpen" : true
},
{
"listId" : 24,
"id" : 876,
"name" : "Critical",
"type" : "severity",
"isHigh" : true
} ],
"roles" : [ {
"id" : 3456,
"caseId" : 2009631,
"name": "Case Manager",
"users" : [ {
"id" : 8790,
"userName" : "exampleUser8790",
"isActive" : true,
"links" : {
"self": "https://<host>/v1/hubs/6435/enduserlists/201/users/8790"
}
} ]
} ]
},
{
"id" : 3457,
"caseId" : 2009631,
"name": "Watcher",
"users" : []
} ],
"source" : {
"responseId" : "452651",
"surveyId" : "p41560",
"sourceId" : "s3"
},
"links" : {
"self" : "http://<host>/v1/actionmanagement/hubs/96/cases/2009631",
"notes" : "http://<host>/v1/actionmanagement/hubs/96/cases/2009631/notes"
}
}
The above example case has two roles; the Case Manager role has a single user assigned, and the Watcher role has no users assigned.
To add a user to a case role, insert a user from the Action Management End User list into the applicable role(s), and submit the full case via the Case Update endpoint. In the following example, we will add user 8791 to the Watcher role.
PUT https://<host>/v1/actionmanagement/hubs/6435/cases/2009631
{
"id" : 2009631,
"name" : "Example case",
"workflowId" : 3536,
"cost" : 250,
"triggerId" : 7315,
"triggerName" : "Example trigger",
"dateCreated" : "2021-10-01T00:00:00-07:00",
"dateModified" : "2021-10-04T00:00:00-07:00",
"listValues" : [ {
"listId" : 23,
"id" : 987,
"name" : "In Progress",
"type" : "status",
"isOpen" : true
},
{
"listId" : 24,
"id" : 876,
"name" : "Critical",
"type" : "severity",
"isHigh" : true
} ],
"roles" : [ {
"id" : 3456,
"caseId" : 2009631,
"name": "Case Manager",
"users" : [ {
"id" : 8790,
"userName" : "exampleUser8790",
"isActive" : true,
"links" : {
"self": "https://<host>/v1/hubs/6435/enduserlists/201/users/8790"
}
} ]
} ]
},
{
"id" : 3457,
"caseId" : 2009631,
"name": "Watcher",
"users" : [ {
"id" : 8791,
"userName" : "exampleUser8791",
"isActive" : true,
"links" : {
"self": "https://<host>/v1/hubs/6435/enduserlists/201/users/8791"
}
} ]
} ],
"source" : {
"responseId" : "452651",
"surveyId" : "p41560",
"sourceId" : "s3"
}
}
Accept: application/json
Authorization: Bearer <access_token>
{
"id" : 2009631,
"name" : "Example case",
"workflowId" : 3536,
"cost" : 250,
"triggerId" : 7315,
"triggerName" : "Example trigger",
"dateCreated" : "2021-10-01T00:00:00-07:00",
"dateModified" : "2021-10-04T00:00:00-07:00",
"listValues" : [ {
"listId" : 23,
"id" : 987,
"name" : "In Progress",
"type" : "status",
"isOpen" : true
},
{
"listId" : 24,
"id" : 876,
"name" : "Critical",
"type" : "severity",
"isHigh" : true
} ],
"roles" : [ {
"id" : 3456,
"caseId" : 2009631,
"name": "Case Manager",
"users" : [ {
"id" : 8790,
"userName" : "exampleUser8790",
"isActive" : true,
"links" : {
"self": "https://<host>/v1/hubs/6435/enduserlists/201/users/8790"
}
} ]
} ]
},
{
"id" : 3457,
"caseId" : 2009631,
"name": "Watcher",
"users" : [ {
"id" : 8791,
"userName" : "exampleUser8791",
"isActive" : true,
"links" : {
"self": "https://<host>/v1/hubs/6435/enduserlists/201/users/8791"
}
} ]
} ],
"source" : {
"responseId" : "452651",
"surveyId" : "p41560",
"sourceId" : "s3"
},
"links" : {
"self" : "http://<host>/v1/actionmanagement/hubs/96/cases/2009631",
"notes" : "http://<host>/v1/actionmanagement/hubs/96/cases/2009631/notes"
}
}
The response of the PUT request is the full Case with the updated user assignments.
The entire user object from the End Users endpoints is supported, but not required, in the PUT request. |