Create a job template
Create a job template by defining job template properties. Using Job
as the default assignment when creating a job template will automatically assign the first step in the job to the person who creates the job. If the assignment of the job is updated to a different user during job creation the job template's assignment will be overridden in the new job. Additional properties called extended property tables can be added to your job template during creation. These tables consist of different extended properties based on your business needs. Each property in a table must have a unique name. Two tables can have properties with the same unique name. The adminBasic or adminAdvanced privilege is required.
Job Template Parameters:
Parameter | Description | Data Type |
---|---|---|
jobTemplateId | Optional. Define the unique ID of the job template to be created. | String |
jobTemplateName | Required. Define the name of the job template to be created. | String |
category | Optional. Define the category of the job template to be created. | String |
diagramId | Required. The Id of the diagram to be associated with the job template to be created. | String |
diagramName | Required. The name of the diagram to be associated with the job template to be created. | String |
diagramThumbnail | Optional. Define the diagram thrumbnail of the job template to be created. | String |
defaultJobName | Optional. Define the default job name on a job template. If null, it is set to JOB . | String |
defaultAssignedType | Optional. Define the default assignment type on a job template. Allowed types are User , Group , Unassigned . If null, it is set to Unassigned . | String |
defaultAssignedTo | Optional. Define the default assignment on a job template. Required only if the default assignment type is User or Group . | String |
description | Optional. Define the description of the job template to be created. | String |
defaultDescription | Optional. Define the default description of the job template to be created. It will be overwritten if the description is defined when creating jobs using the job template. | String |
jobStartDateType | Optional. Define the type of the default start date on a job template. Allowed types are Creation and Specific . If null, it is set to Creation . | String |
defaultStartDate | Optional. Define the default start date on a job template. If job start date type is Creation , then this field is ignored. | Date |
defaultDueDate | Optional. Define the default end date on a job template. | Date |
defaultJobDuration | Optional. Define the default job duration on a job template. Use this in place of default to specify the default due date to be some number of days after the start date. This field is ignored if default is specified. | Date |
defaultPriorityName | Required. Define the initial priority on a job template. If no matching property is found in the priorities lookup table, then the first priority value will be used. | String |
defaultStatus | Required. Define the initial job status on a job template. Cannot be null or an empty string. | String |
defaultFinalStatus | Required. Define the final job status on a job template. Cannot be null or an empty string. | String |
activities | Optional. Define job activities on a job template to trigger sending the email or web requests. | Array[Activity] |
extendedPropertyTableDefinitions | Optional. Define additional properties on a job template specific to your business needs. | Array[ExtendedPropertyTableDefinition] |
state | Required. Set the initial state of the job template. Allowed states are Draft , Active , Retired . | String |
ExtendedPropertyTableDefinition Parameters:
Parameter | Description | Data Type |
---|---|---|
tableName | Required. The unique name of the table to be created. The name must be unique across all job templates in the system. | String |
tableAlias | Required. Display name for the table. Display name doesn't need to be unique and can be duplicated in the system. | String |
tableOrder | Required. Order in which the tables will appear. | Integer |
relationshipType | Required. Allows you to define the relationship between the table and the job. Allowed values are Oneto and Oneto . OnetoMany means that there can be any number of records in each table for each job. OnetoOne means that there will be 1 record in each configured table for each job. | String |
featureServiceProperties | Optional. Only applicable when creating feature service extended properties.If featureServiceProperties parameters are not specified the extended property table will be created as a standard table. | FeatureServiceProperties |
extendedPropertyDefinitions | Required. Define different properties in the table. | Array[ExtendedPropertyDefinition] |
updateExisting | Optional. An existing table will be updated if set to true. | Boolean |
associateToExisting | Optional. Associate an existing extended property table with this job template. | Boolean |
FeatureServiceProperties Parameters:
Parameter | Description | Data Type |
---|---|---|
itemId | Required. ItemId for the feature service in Portal or AGOL. | String |
itemType | Optional. If the feature service is a Survey123 form, the itemType must be defined as SurveyForm. | String |
layerId | Required. LayerId for the layer in the Feature service that will be added as an extended property table | String |
portalType | Required. Specify where the feature service is located. Current for feature services available on the same portal as Workflow Manager, ArcGIS for feature services available on AGOL and Other for public feature services available on a different portal | String |
portalUrl | Optional. Specify the complete portal url for the feature service. This field is only required for portalType Other | String |
featureServiceUniqueId | Required. Unique field defined on the feature service layer to be associated with the extended properties table. | String |
secure | Optional. Specify whether the feature service is secure or not. Default value for secure is false when it is not specified. For portalType Current secure is set to true by default. | Boolean |
ExtendedPropertyDefinition Parameters:
Parameter | Description | Data Type |
---|---|---|
propertyName | Required. Name of the property inside the table. It can only contain lowercase letters, numbers or underscores. Each property in a table must have a unique name. Two tables can have properties with the same unique name. | String |
propertyAlias | Required. Display name for the property. | String |
propertyOrder | Required. The order in which the proeprty will appear inside the table. | Integer |
dataType | Required. DataType for the property inside the table. Allowed data types are Integer , Double , Boolean , Date or String . For feature service or survey 123 extended properties, the data type is set as Unknown . | String |
defaultValue | Optional. The default value placed in the field when the record is created for this property. The default value of a string field dataType cannot exceed the fieldLength limit. The maximum allowed length is 5000 characters, even if the fieldLength size is greater than 5000. | Value based on DataType |
fieldLength | Required for string dataType, not applicable and can be omitted for other types. | Integer |
required | Required. Whether the property value is required or not. For feature service extended properties this will be set to false by default. | Boolean |
editable | Required. Whether the property can be edited or not. For feature service extended properties, only the field defined as the featureServiceUniqueId is editable. | Boolean |
visible | Required. Whether the property is visible to the user in the client application. | Boolean |
domain | Optional. Used when using domains to constrain values allowed for a particular property. Domains are only supported for Integer , Double , and String data types. It is not supported for Boolean and Date types and will be ignored for those types. | Domain |
Domain Parameters:
Parameter | Description | Data Type |
---|---|---|
type | Required. Specify the type of domain being used, codedValue or range. | String |
codedValues | Optional. Specify an array of valid codes and names for a property. | Array[CodedValue] |
range | Optional. Specify a range of valid minimum and maximum values for a property. For example, ["1","5"] | Array[String] |
CodedValue Parameters:
Parameter | Description | Data Type |
---|---|---|
code | Required. Specify a value for the property. | Integer, Double, String |
name | Required. User-friendly description of what the code actually means. | String |
Activity Parameters:
Parameter | Description | Data Type |
---|---|---|
typeName | Required. The name of the job activity. The allowed activity type names are create , close , add , set , assign , and delete . | String |
actionName | Required. The action name triggered by the job activity. The allowed action names are Email and Web . Web action requires the Workflow Manager Advanced license and does not support create activity. | String |
templateId | Required. The id of the template being used to send email or web request. | String |
Body parameter
{
"jobTemplateId": "string",
"jobTemplateName": "string",
"category": "string",
"defaultJobDuration": 0,
"defaultAssignedTo": "string",
"defaultDueDate": "2019-08-24T14:15:22Z",
"defaultStartDate": "2019-08-24T14:15:22Z",
"jobStartDateType": "CreationDate",
"diagramId": "string",
"diagramName": "string",
"diagramThumbnail": "string",
"defaultPriorityName": "string",
"defaultAssignedType": "Unassigned",
"description": "string",
"defaultDescription": "string",
"state": "Draft",
"defaultJobName": "string",
"defaultFinalStatus": "string",
"defaultStatus": "string",
"activities": [
{
"typeName": "CloseJob",
"actionName": "Email",
"templateId": "string"
}
],
"extendedPropertyTableDefinitions": [
{
"tableName": "string",
"tableAlias": "string",
"tableOrder": 0,
"relationshipType": "OneToOne",
"featureServiceProperties": {
"itemId": "string",
"itemType": "SurveyForm",
"layerId": "string",
"portalType": "Current",
"portalUrl": "string",
"featureServiceUniqueId": "string",
"secure": true
},
"extendedPropertyDefinitions": [
{
"propertyName": "string",
"propertyAlias": "string",
"propertyOrder": 0,
"dataType": "String",
"defaultValue": {},
"fieldLength": 0,
"required": true,
"editable": true,
"visible": true,
"domain": {
"type": "codedValue",
"codedValues": [
{}
],
"range": [
"string"
]
}
}
],
"updateExisting": true,
"associateToExisting": true,
"isAssociated": true
}
],
"lastUpdatedBy": "string",
"lastUpdatedDate": "2019-08-24T14:15:22Z"
}
Query parameters
Name | Type | Required |
---|---|---|
|
|
Path parameters
Name | Type | Required |
---|---|---|
|
| |
|
|
Examples
Request
# You can also use wget
curl -X POST /{orgId}/{itemId}/jobTemplates \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
Response
200 Response
{
"jobTemplateId": "string"
}
Status | Meaning | Description | Schema |
---|---|---|---|
| success | Inline | |
| error |
Response details
Status Code 200
CreateJobTemplateResponse
Name | Type | Required |
---|---|---|
|
|