3D Repo allows for the creation of "Custom Tickets" which are based around form templates. Templates are assigned to a Teamspace and each Teamspace can hold any number of templates. Once a template has been created users of the Teamspace can create new instances of the ticket based on the template. It is possible to update templates without affecting previously created tickets.
In this guide we will demonstrate how to create a template using the API, what fields are allowed and what modules you can use out of the box.
The Request
Templates are added to a teamspace using a POST request as detailed in the interactive 3D Repo Swagger API documents linked below:
Below is an example of a CURL request posting a new ticket template to a designated teamspace. As you can see you will need to provide a json body with a schema as detailed in the next section, along with your teamspace name and API key. Only teamspace admins can create new tickets.
curl --location --request POST 'https://www.3drepo.io/api/v5/teamspaces/{teamspace}/settings/tickets/templates?key={API Key}' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Test",
"code": "XYZ",
"config": {
"comments": true,
"issueProperties": true,
"defaultView": true,
"defaultImage": true,
"pin": true,
"attachments": true },
"deprecated": false
}'
The response to posting a new ticket template will be a template ID, you can use this ID to update the template at a later date using the Update Template API call, and you can always recover the list of all the templates on a project using the Ticket Template list API call.
The Schema
Below is an example ticket schema, we will then breakdown each section one by one.
{
"name":"Example Ticket",
"code":"EXT",
"config":{
"issueProperties":true,
"defaultView":true,
"defaultImage":true,
"pin":true
},
"deprecated":false,
"modules":[
{
"name":"Accordian Header 1",
"deprecated":false,
"properties":[
{
"name":"Required Text Field",
"type":"text",
"deprecated":false,
"required":true
},
{
"name":"Long Text Field",
"type":"longText",
"deprecated":false
},
{
"name":"Boolean Switch",
"type":"boolean",
"deprecated":false
},
{
"name":"Number Field",
"type":"number",
"deprecated":false
},
{
"name":"Drop Down single select",
"type":"oneOf",
"deprecated":false,
"values":[
"Option 1",
"Option 2",
"Option 3"
]
},
{
"name":"Drop Down multiple select",
"type":"manyOf",
"deprecated":false,
"values":[
"Option 1",
"Option 2",
"Option 3"
]
},
{
"name":"Drop Down user select",
"type":"manyOf",
"deprecated":false,
"values":"jobsAndUsers"
},
{
"name":"Image field",
"type":"image",
"deprecated":false
},
{
"name":"Date Field",
"type":"date",
"deprecated":false
},
{
"name":"Viewpoint field",
"type":"view",
"deprecated":false
},
{
"name":"Pin field",
"type":"coords",
"deprecated":false
},
{
"name":"Second Pin field",
"type":"coords",
"deprecated":false
}
]
}
]
}
Settings
name | string | The name of the given template. |
code | 3 char string | The prefix given to all tickets using this template. |
config | object | The configuration of the standard custom tickets modules. (see below table) |
deprecated | boolean | If true then the template will no longer be available for users inside the teamspace. |
module (optional) | list | Additional data grouped into modules, each of which is placed within an accordion in the 3D Repo ticket creation screen (see below table) |
Config
issueProperties | boolean | Whether the 3D Repo default issue properties (Priority, Assignee, Due Date and Status) are used in this ticket. |
defaultView | boolean | Whether a default viewpoint is used in this ticket (additional views can be included in custom modules) |
defaultImage | boolean | Whether a default image is used in this ticket (additional images can be included in custom modules) |
pin | boolean | Whether the user can place a pin when creating a ticket |
Modules
name | string | The name of the given module. This appears as the title of the accordion |
deprecated | boolean | If true then the module will no longer be available for users inside the teamspace. |
properties | list | A list of form fields to be shown in the module using. Please see the Custom Tickets Properties article for information
|