Automatic Rules in Targetprocess
Webhook plugin is deprecated.
Please use the Automation Rules feature instead, unless you're on the old Targetprocess version (older than Targetprocess v3.13.0) or on a local On-Site installations.
We have several Business Rules (Custom Rules) available in Targetprocess to automate a number of actions (for example, start a User Story when one of its Tasks have been started). However, you may want to automate an action which is not listed as a business rule, like the assignment of a default user to a newly created item or creation of a default User Story set for a new Feature. Some of these actions can be automated using the Webhooks Plugin.
The Webhooks Plugin listens to data modification events (Create, Update, Delete) in Targetprocess. When some event occurs, the plugin receives a signal and sends a piece of custom information to some external service. Key point here is that we can send information back to Targetprocess itself. As a result automatic actions are performed by Targetprocess Webhooks and REST API chain.
Here are some examples of what actions can be automated:
- Create a set of entities e.g. child Tasks, User Stories when a parent User Story or Feature is created. Or, create related entities, for instance, Bugs, from incoming Requests
- Create project structure (list of Features or User Stories) depending on the selected template
- Set a default field value (e.g. Description, Business Value, etc.) for newly created entities (e.g. User Stories, Bugs)
- Change state of an entity, for example, close parent entity (e.g. Feature) when all its child entities (e.g. Bugs and User Stories) are closed
- Assign entities to users. Assign an entity (e.g. User Story or Bug) to the user who created it or moved to some state (e.g. In Testing). Assign a default user(s) (e.g. QA Engineers or Support Agents) to a newly created entities (e.g. Bugs or Requests)
- Assign a default requester to newly created Requests
- Assign a Team to a newly created entity or to an entity that is moved to some state
- Subscribe assigned user and creator / owner user as a follower to an entity
- Set Planned Dates depending on the Custom Field value or on other dates
Webhooks send only POST requests to API
In Targetprocess API, entities are created and updated, elements to collections are appended with POST requests. In the meantime, entities are deleted and elements from collections are removed with DELETE requests. Webhooks cannot send requests of this kind. It means you cannot delete entities, unassign users and teams, remove users from lists of followers and requesters with webhooks.
Below are instructions for setting up this automation.
First Things First: Getting an Access Token for Targetprocess
For Webhook setup we recommend using the token of the System User. It can be generated by opening the following URL: https://your-targetprocess-address/api/v1/Authentication?login=System
Here everything inside of the quotations marks (including the final two ==) is the token.
Other ways of obtaining access token are available here.
Moving On: Create a New Webhook Profile in Targetprocess
Now we need to create a new profile for the Webhooks plugin in Targetprocess at Settings β System Settings β Plugins.
The exact configuration of the plugin will depend on the action you'd like to automate. We'll look into some examples below.
Obtain IDs used in Custom Rules from the system
To connect items together you'll need to know various IDs (of roles, of users, of teams, etc.).
For example, you can find the ID of a role at Settings β Roles:
And the ID of a user can be found in the People list:
Updated 3 months ago