Assign Users
These webhooks assign users to work items in Targetprocess.
All the assignments are added to the list of already existing ones. You cannot unassign a user from an entity using webhooks.
Prerequisites: IDs of Users
Some of these examples contain IDs of the default Users as parameters. When you modify User assignments you have to pass proper numeric ID of a chosen user in your POST calls. IDs can be obtained from the People views or from the system directly.
Get IDs of Users
Use special GET call to API to obtain numeric IDs of Users from your system.
/api/v1/Users?include=[Id,FirstName,LastName,Login,Email,IsActive]&where=LastName contains "Smith"```
Prerequisites: IDs of Roles
The templates in these examples contain IDs of the Roles as parameters. In your particular template you have to pass numeric ID of a chosen role obtained from system settings.
Get IDs of Roles
Use special GET call to API to obtain numeric IDs of Roles from your system.
/api/v1/Roles?include=[Id,Name]&take=1000
Assign a Bug to the User who started it
Please consider using the following Automation Rule instead of this webhook.
https://your-targetprocess-address/api/v1/Bugs?token=[your token]
Update Bug
//for the Project "My Project"
ProjectName == "My Project" and ChangedFields.Contains("EntityStateName") and EntityStateName == "In Progress"
// the person who changed the state is assigned to a Bug with the Role Developer (ID #10)
{"Id":{{ID}},"Assignments":{"Items": [{"GeneralUser":{"Id":{{AuthorID}}},"Role":{"Id":10}}]}}
Assign a default user(s) to a newly created Request from Support projects
Please consider using the following Automation Rule instead of this webhook.
https://your-targetprocess-address/api/v1/Requests?token=[your token]
Create Request
//for all the Projects that have "Support" in their name.
ProjectName.Contains("Support")
// a default user Jane Smith (ID #1) is assigned to a Request with the Role Support Person (ID #13)
{"Id":{{ID}},"Assignments":{"Items": [{"GeneralUser":{"Id":1},"Role":{"Id":13}}]}}
// a default user Jane Smith (ID #1) is assigned to a Request with the Role Support Person (ID #13)
// a default user John Black (ID #8) is assigned to a Request with the Role Top Manager (ID #8)
{
"Id": {{ID}},
"Assignments": {
"Items": [
{"GeneralUser": {"Id": 1}, "Role": {"Id": 13}},
{"GeneralUser": {"Id": 8}, "Role": {"Id": 8}}
]
}
}
Updated 5 months ago