createJobTemplate

Click to copy

Create a job template

Create a job template by defining job template properties. Using JobCreator($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:

ParameterDescriptionData Type
jobTemplateIdOptional. Define the unique ID of the job template to be created.String
jobTemplateNameRequired. Define the name of the job template to be created.String
categoryOptional. Define the category of the job template to be created.String
diagramIdRequired. The Id of the diagram to be associated with the job template to be created.String
diagramNameRequired. The name of the diagram to be associated with the job template to be created.String
diagramThumbnailOptional. Define the diagram thrumbnail of the job template to be created.String
defaultJobNameOptional. Define the default job name on a job template. If null, it is set to JOB_[index].String
defaultAssignedTypeOptional. Define the default assignment type on a job template. Allowed types are User, Group, Unassigned. If null, it is set to Unassigned.String
defaultAssignedToOptional. Define the default assignment on a job template. Required only if the default assignment type is User or Group.String
descriptionOptional. Define the description of the job template to be created.String
defaultDescriptionOptional. 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
jobStartDateTypeOptional. Define the type of the default start date on a job template. Allowed types are CreationDate and SpecificDate. If null, it is set to CreationDate.String
defaultStartDateOptional. Define the default start date on a job template. If job start date type is CreationDate, then this field is ignored.Date
defaultDueDateOptional. Define the default end date on a job template.Date
defaultJobDurationOptional. Define the default job duration on a job template. Use this in place of defaultDueDate to specify the default due date to be some number of days after the start date. This field is ignored if defaultDueDate is specified.Date
defaultPriorityNameRequired. 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
defaultStatusRequired. Define the initial job status on a job template. Cannot be null or an empty string.String
defaultFinalStatusRequired. Define the final job status on a job template. Cannot be null or an empty string.String
activitiesOptional. Define job activities on a job template to trigger sending the email or web requests.Array[Activity]
extendedPropertyTableDefinitionsOptional. Define additional properties on a job template specific to your business needs.Array[ExtendedPropertyTableDefinition]
stateRequired. Set the initial state of the job template. Allowed states are Draft, Active, Retired.String

ExtendedPropertyTableDefinition Parameters:

ParameterDescriptionData Type
tableNameRequired. The unique name of the table to be created. The name must be unique across all job templates in the system.String
tableAliasRequired. Display name for the table. Display name doesn't need to be unique and can be duplicated in the system.String
tableOrderRequired. Order in which the tables will appear.Integer
relationshipTypeRequired. Allows you to define the relationship between the table and the job. Allowed values are OnetoMany and OnetoOne. 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
featureServicePropertiesOptional. 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
extendedPropertyDefinitionsRequired. Define different properties in the table.Array[ExtendedPropertyDefinition]
updateExistingOptional. An existing table will be updated if set to true.Boolean
associateToExistingOptional. Associate an existing extended property table with this job template.Boolean

FeatureServiceProperties Parameters:

ParameterDescriptionData Type
itemIdRequired. ItemId for the feature service in Portal or AGOL.String
itemTypeOptional. If the feature service is a Survey123 form, the itemType must be defined as SurveyForm.String
layerIdRequired. LayerId for the layer in the Feature service that will be added as an extended property tableString
portalTypeRequired. Specify where the feature service is located. Current for feature services available on the same portal as Workflow Manager, ArcGISOnline for feature services available on AGOL and Other for public feature services available on a different portalString
portalUrlOptional. Specify the complete portal url for the feature service. This field is only required for portalType OtherString
featureServiceUniqueIdRequired. Unique field defined on the feature service layer to be associated with the extended properties table.String
secureOptional. 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:

ParameterDescriptionData Type
propertyNameRequired. 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
propertyAliasRequired. Display name for the property.String
propertyOrderRequired. The order in which the proeprty will appear inside the table.Integer
dataTypeRequired. DataType for the property inside the table. Allowed data types are Integer, Double, Boolean, DateTime or String. For feature service or survey 123 extended properties, the data type is set as Unknown.String
defaultValueOptional. 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
fieldLengthRequired for string dataType, not applicable and can be omitted for other types.Integer
requiredRequired. Whether the property value is required or not. For feature service extended properties this will be set to false by default.Boolean
editableRequired. Whether the property can be edited or not. For feature service extended properties, only the field defined as the featureServiceUniqueId is editable.Boolean
visibleRequired. Whether the property is visible to the user in the client application.Boolean
domainOptional. 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 DateTime types and will be ignored for those types.Domain

Domain Parameters:

ParameterDescriptionData Type
typeRequired. Specify the type of domain being used, codedValue or range.String
codedValuesOptional. Specify an array of valid codes and names for a property.Array[CodedValue]
rangeOptional. Specify a range of valid minimum and maximum values for a property. For example, ["1","5"]Array[String]

CodedValue Parameters:

ParameterDescriptionData Type
codeRequired. Specify a value for the property.Integer, Double, String
nameRequired. User-friendly description of what the code actually means.String

Activity Parameters:

ParameterDescriptionData Type
typeNameRequired. The name of the job activity. The allowed activity type names are createJob, closeJob, addComment, setCurrentStep, assignJob, and deleteJob.String
actionNameRequired. The action name triggered by the job activity. The allowed action names are Email and WebRequest. WebRequest action requires the Workflow Manager Advanced license and does not support createJob activity.String
templateIdRequired. The id of the template being used to send email or web request.String

Body parameter

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
{
  "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

NameTypeRequired

token

string

Path parameters

NameTypeRequired

orgId

string

itemId

string

Examples

Request

Use dark colors for code blocksCopy
1
2
3
4
5
# 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

Use dark colors for code blocksCopy
1
2
3
{
  "jobTemplateId": "string"
}
StatusMeaningDescriptionSchema

200

OK

success

Inline

404

Not Found

error

WorkflowExceptionDTO

Response details

Status Code 200

CreateJobTemplateResponse

NameTypeRequired

jobTemplateId

string

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.