Create New Entities

Create a set of default Tasks when a User Story is created

👍

Please consider using the following Automation Rule instead of this webhook.

To create new Tasks, within Template you should send collection of JSON objects. One object represent one Task. For each Task you must specify Name of the Task and numeric IDs of the parent Project and User Story. In the default template provided below Tasks are created in the same project where the User Story is, and this logic must be always preserved.

https://your-targetprocess-address/api/v1/Tasks/bulk?token=[your token]
Create User Story
//for Projects with ID 128 or 156 or 219 
//for new stories with DOD3 text in the name 

ProjectID in [128, 156, 219] and Name.Contains("DOD3")
{% comment %}
8 Tasks are added to each newly created User Story with DOD3 in Name
Tasks are placed into the User Story's Project and connected to the User Story itself
{% endcomment %}

[
 {Name:"[DOD] Kick-start meeting",Project:{Id:{{ProjectID}}},UserStory:{Id:{{ID}}}},
 {Name:"[DOD] Actual specs",Project:{Id:{{ProjectID}}},UserStory:{Id:{{ID}}}},
 {Name:"[DOD] Passed set of manual TCs",Project:{Id:{{ProjectID}}},UserStory:{Id:{{ID}}}},
 {Name:"[DOD] Subset of TCs automated",Project:{Id:{{ProjectID}}},UserStory:{Id:{{ID}}}},
 {Name:"[DOD] Green build",Project:{Id:{{ProjectID}}},UserStory:{Id:{{ID}}}},
 {Name:"[DOD] Content review",Project:{Id:{{ProjectID}}},UserStory:{Id:{{ID}}}},
 {Name:"[DOD] Documentation",Project:{Id:{{ProjectID}}},UserStory:{Id:{{ID}}}},
 {Name:"[DOD] Demo meeting",Project:{Id:{{ProjectID}}},UserStory:{Id:{{ID}}}}
]

Create related Bugs from incoming Requests

👍

Please consider using the following Automation Rule instead of this webhook.

To create new Bug, within Template you should send a JSON object. For a Bug you must specify Name of the Bug and numeric ID of the parent Project. In the default template provided below Bug is created in the same project where the Request is. Description is also specified in order to make it the same as in the incoming Request. Also within the same template a new Relation object is passed in order to make the Bug connected to the Request via Relations.

https://your-targetprocess-address/api/v1/bugs?token=[your token]
Create Request
//don't use any filter if you'd like it to work for all the requests

OwnerId == 1
{
"Name":"{{Name | Replace: '"', '\"'}}",
"Project":{"Id":{{ProjectID}}},
"Description":"{{Description | Replace: '"', '\"'}}",
"SlaveRelations":{"Items": [{"Slave":{"Id":{{ID}}},"RelationType":{"Id":3}}]}
}

Create Project structure when Template is selected

👍

Please consider using the similar Automation Rule instead of this webhook.

How the rule works: when a user creates a new Project entity, a dropdown with multiple "Template" options appears on "Add" form. When a user selects one of the "Templates" and pushes "Add" button, a new Project is created. Targetprocess webhook immediately populates the project with a set of predefined nested items - Features and User Stories. Names and content of the items depend on the selected "Template".

This rule has prerequisites and requires some initial configuration:

  1. Login to Targetprocess as Administrator.
  2. Add Custom Field of type Drop Down List with name "Template" for Project entity. The field should be set as "Required". In the use case below the field has 3 options: Initiative, Research, Proposal.
  3. Set up the webhook as described below.
https://your-targetprocess-address/api/v1/Features/bulk?token=[your token]
Create Project
Template != ""
[
{% if {{Template}} == "Initiative" %}
	{% comment %}
	Features created when "Initiative" template is selected
	{% endcomment %}
	{
		Project:{Id:{{ID}}},
		Name:"UX",
		UserStories:[
			{Project:{Id:{{ID}}},Name:"Make a prototype"},
			{Project:{Id:{{ID}}},Name:"Write documentation"}
		]
	},
	{
		Project:{Id:{{ID}}},
		Name:"Implementation",
		UserStories:[
			{Project:{Id:{{ID}}},Name:"First part of work"},
			{Project:{Id:{{ID}}},Name:"Second part of work"}
		]
	}
{% elseif {{Template}} == "Research" %}
	{% comment %}
	Features created when "Research" template is selected
	{% endcomment %}
	{
		Project:{Id:{{ID}}},
		Name:"Phase 1",
		UserStories:[
			{Project:{Id:{{ID}}},Name:"US1"},
			{Project:{Id:{{ID}}},Name:"US2"}
		]
	},
	{
		Project:{Id:{{ID}}},
		Name:"Phase 2",
		UserStories:[
			{Project:{Id:{{ID}}},Name:"US3"},
			{Project:{Id:{{ID}}},Name:"US4"}
		]
	}
{% else %}
	{% comment %}
	Features created when any other template is selected
	{% endcomment %}
	{
		Project:{Id:{{ID}}},
		Name:"First Feature",
		UserStories:[
			{Project:{Id:{{ID}}},Name:"US1"},
			{Project:{Id:{{ID}}},Name:"US2"}
		]
	},
	{
		Project:{Id:{{ID}}},
		Name:"Second Feature",
		UserStories:[
			{Project:{Id:{{ID}}},Name:"US3"},
			{Project:{Id:{{ID}}},Name:"US4"}
		]
	}
{% endif %}
]