Module: job

Copyright 2020 Parsable, Inc
API address: /api/jobs
Functionality for Jobs. A Job is an instance of a Job Template - it is a single episode of that Template.

A Job's steps can be edited while the Job is in progress - for example, adding a step. This edits the Job's steps, but doesn't change the Job's JobTemplate.

ModuleServicesData typesConstants
jobJobService
AddPlannerParams
AddUserParams
CompleteOpts
ExecutionSnippet
FieldExecutionData
GetDataOptions
GetDataResult
IntegrationResponse
IntegrationStatus
IssueJobLink
Job
JobActivity
JobCompletionCode
JobDeviationRef
JobDeviationType
JobDocument
JobFetchResult
JobFilterQueryOpts
JobModular
JobModularParams
JobOrder
JobOrderBy
JobParams
JobQueryResult
JobQueryUpdatedResult
JobRecurringRule
JobSelectOpts
JobState
JobStats
JobTextSearch
JobType
JobUser
JobWhereOpts
PriorityLevel
RecurredJobInfo
SendDataResult
StepExecutionData
StepGroupExecutionData
StepState
TemplateOrSetRef

Enumerations

Enumeration: JobType


Normal0
Recurring1
RecurringWithError2
Issue3
AdHoc4
WorkflowJob5
WorkflowIssue6

Enumeration: JobState


PLANNED1
ACTIVE2
COMPLETED3

Enumeration: StepState


STARTED0
PAUSED1
RESUMED2

Enumeration: IntegrationStatus


PENDING1
SUCCESS2
ERROR3

Enumeration: JobDeviationType


DEVIATION_INPUT_NA0 1. Inputs marked N/A
DEVIATION_STEP_NA1 2. Steps marked N/A
DEVIATION_STEP_GROUP_NA2 3. Step groups marked N/A
DEVIATION_TEMPLATE_NA3 4. Templates marked N/A
DEVIATION_INPUT_EMPTY4 5. Inputs marked empty if parent step is completed
DEVIATION_INPUT_RANGE5 6. Inputs out of range but is not N/A
DEVIATION_STEP_INCOMPLETE6 7. Incomplete steps if job is completed
DEVIATION_CONDITIONAL_INCOMPLETE7 8. Unused conditionals if job is completed
DEVIATION_CALCULATED_INPUT_EMPTY8 9. Calculated fields missing underlying input fields (one or more empty) if parent step is completed
DEVIATION_INPUT_COMPLETE9 9. Inputs marked complete if parent step is completed
DEVIATION_VALIDATION_TRIGGERED10 10. Inputs for expected values with validation rule triggered

Enumeration: JobOrderBy


TITLE1
CREATED_AT2
PLANNED_START_AT3
LAST_MODIFIED_AT4
JOB_TYPE5
STARTED_AT6
COMPLETED_AT7
LOOKUP_ID8

Data structures

Struct: PriorityLevel

KeyFieldTypeDescriptionRequirednessDefault value
1priorityi32default
2titlestringdefault
3idstringunique identifier for a priority level, not a uuid for now default
4archivedAti64priorities cannot currently be archived. this is future proofing for old clients default

Struct: JobParams

KeyFieldTypeDescriptionRequirednessDefault value
1titlestringTitle of the job optional
2plannedStartAti64expected start date optional
3skipPlanningboolstart immediately (legacy model) defaulttrue
4enableMeshbooloptional
5startAutoboolIf true then will start job automatically on planned start at optional
6typJobTypeOn creation, Specify the job type.
Normal, Issue and AdHoc are accepted on creation.
JobType is Normal if null.
In updateJob, can be explicitly set to change between:
1) Normal -> AdHoc
2) Recurring -> AdHoc
3) AdHoc -> Normal
Any other type changes will be rejected with error.
Setting to null performs no type changes.
optional
7srcmessaging.JobPtrIf JobType is Issue, optionally specify a source of the issue.
If job is an instance started from an AdHoc (on-demand) job, specify the source job.
Currently, only accepting references down to the detail of a step/group.
optional
8priorityPriorityLeveloptional
9locationstringoptional
10plannedStartJobRoleIdslist<string>If JobType is AdHoc, this must be a non-empty, valid job role id list for the user starting an ad hoc job to be assigned the following roles. This is in addition to the roles already assigned to this user during planning. optional
11attributeslist<abac.AbacAttribute>desired attributes on job object should match creating users attributes optional
12enableStepTrackingbooloptional
13expiresAti64optional
14expiresAfterSecondsi64optional
30dupJobIdstringJob to duplicate from, currently only template ref values are being copied over, skipping the need for validation and reducing traffic optional

Mutable parts of a Job

Union: TemplateOrSetRef

KeyFieldTypeDescriptionRequirednessDefault value
1templateIdstringdefault
2templateSetIdstringdefault

Struct: AddUserParams

KeyFieldTypeDescriptionRequirednessDefault value
1userIdstringoptional
2emailstringoptional
3jobRoleIdstringrequired

Struct: AddPlannerParams

KeyFieldTypeDescriptionRequirednessDefault value
1userIdstringoptional
2emailstringoptional

Struct: JobModularParams

KeyFieldTypeDescriptionRequirednessDefault value
1teamIdstringdefault
2titlestringTitle of the job default
3plannedStartAti64expected start date optional
4skipPlanningboolstart immediately (legacy model) defaulttrue
5templateRefslist<TemplateOrSetRef>default
6userslist<AddUserParams>default
7plannerslist<AddPlannerParams>default
8documentIdslist<string>default
9metadataEntrieslist<metadata.MetadataEntry>default
10typJobTypedefault
11srcmessaging.JobPtrIf JobType is Issue, optionally specify a source of the issue.
If job is an instance started from an AdHoc (on-demand) job, specify the source job.
Currently, only accepting references down to the detail of a step/group.
optional
12priorityPriorityLeveloptional
13attributeslist<abac.AbacAttribute>default
14plannedStartJobRoleIdslist<string>If JobType is AdHoc, this must be a non-empty, valid job role id list for the user starting an ad hoc job to be assigned the following roles. This is in addition to the roles already assigned to this user during planning. optional
15plannedDataSheetIdsListlist<map<string, string>>Each entry in plannedDataSheetIds should correspond to an element in templateRefs, in and ordered, 1-to-1 fashion.
Note that an element of templateRefs can be either a Template or a Template Set -- that is, multiple Templates.
So while it's clear how to apply a plannedDataSheetIds element to a single Template, applying it to a Set goes as follows:
The plannedDataSheetIds element will apply to all Templates in the Template Set.
That means, if Template T1 references Data Sheet Set DS1, and Template T2 references Data Sheet Sets DS1 and DS2, then a Set of {T1, T2} references DS1 and DS2.
So for that Template Set, the plannedDataSheeIds element must have key-value pairs for both DS1 and DS2.
Additionally, the selected Data Sheet Value for DS1 will apply to both T1 and T2.
optional
16enableStepTrackingbooloptional
17expiresAti64optional
18expiresAfterSecondsi64optional
20enableMeshbooloptional
30dupJobIdstringJob to duplicate from, currently only template ref values are being copied over, skipping the need for validation and reducing traffic optional

Parts of a Job for creation

Struct: IntegrationResponse

KeyFieldTypeDescriptionRequirednessDefault value
1statusIntegrationStatusdefault
2messagestringoptional
3timestampi64default
4correlationIdstringoptional

Struct: FieldExecutionData

KeyFieldTypeDescriptionRequirednessDefault value
1fieldIdstringdefault
2seqIdi64default
3execDatafield_data.ExecutionDataoptional
4lastUpdatedByIdstringoptional
5lastUpdatedAti64optional
6documentdocument.Documentoptional
7isNotApplicablebooloptional
8isNotApplicableLastUpdatedByIdstringoptional
9isNotApplicableLastUpdatedAti64optional
10integrationResponseIntegrationResponseoptional
11documentslist<document.Document>For document typed execution data, provide doc details. On get, this can be used to estimate download; on send, can specify a pending documents to allocate an ID. optional
1000deviceIdstringFor Mesh optional
1001deviceSeqIdi64optional

Execution data for a particular input field

Struct: StepExecutionData

KeyFieldTypeDescriptionRequirednessDefault value
1stepIdstringdefault
2jobBaseStepIdstringdefault
3stepCompletebooldefault
4fieldExecutionDatalist<FieldExecutionData>default
5isCompletebooloptional
6isCompleteLastUpdatedByIdstringoptional
7isCompleteLastUpdatedAti64optional
8isNotApplicablebooloptional
9isNotApplicableLastUpdatedByIdstringoptional
10isNotApplicableLastUpdatedAti64optional
11seqIdi64default
12stateStepStateFor Step Time Tracking Steps can be explicitly started : this is when the timer clock starts state , 0 = Started, 1 = Paused, 2 = Resumed lastUpdatedAt and lastUpdatedBy are used to track time and user when last action was performed for start/pause/resume isCompleteLastUpdatedById and isCompleteLastUpdatedAt should probably be replaced in future by these 2 fields elapsedDurationUser is the elapsed duration for the user optional
13lastUpdatedAti64optional
14lastUpdatedByIdstringoptional
15elapsedDurationUseri64optional
1000deviceIdstringFor Mesh optional
1001deviceSeqIdi64optional

Execution data for a step

Struct: StepGroupExecutionData

KeyFieldTypeDescriptionRequirednessDefault value
1stepGroupIdstringdefault
2jobBaseStepIdstringdefault
3conditionalIsYesbooloptional
4conditionalLastUpdatedByIdstringoptional
5conditionalLastUpdatedAti64optional
6seqIdi64default
8isNotApplicablebooloptional
9isNotApplicableLastUpdatedByIdstringoptional
10isNotApplicableLastUpdatedAti64optional
1000deviceIdstringFor Mesh optional
1001deviceSeqIdi64optional

Execution data for a step group

Union: ExecutionSnippet

KeyFieldTypeDescriptionRequirednessDefault value
1stepGroupExecDataStepGroupExecutionDatadefault
2stepExecDataStepExecutionDatadefault

Umbrella type for various data sent during execution

Struct: GetDataOptions

KeyFieldTypeDescriptionRequirednessDefault value
1canHandlePendingDocumentsbooldefaultfalse
2includeAllStepTrackingbooloptional

Struct: GetDataResult

KeyFieldTypeDescriptionRequirednessDefault value
1seqIdi64The maximum sequenceId from the accompanying stepExecutionData list default
2stepExecutionDatalist<StepExecutionData>default
3jobCompletedAti64default
4snippetslist<ExecutionSnippet>default
5jobIdstringdefault

Struct: SendDataResult

KeyFieldTypeDescriptionRequirednessDefault value
1jobIdstringdefault
2seqIdi64The maximum sequenceId from the accompanying snippets list default
3snippetslist<ExecutionSnippet>default

Struct: JobUser

KeyFieldTypeDescriptionRequirednessDefault value
1idstringdefault
2jobIdstringdefault
3useruser.Userdefault
4jobRolejob_role.JobRoledefault
5archivedAti64default

Struct: JobCompletionCode

KeyFieldTypeDescriptionRequirednessDefault value
1idstringrequired
2numberi32required
3textstringrequired

Struct: Job

KeyFieldTypeDescriptionRequirednessDefault value
1idstringdefault
2titlestringdefault
3stepGroupstep.BaseStepTop level step group default
4teamteam.Teamdefault
5jobTemplateIdstringTemplate from which this Job was created default
6jobTemplateVersioni32The version of the Job Template that was used to create this Job default
7completedAti64default
8documentEmailAddressstringUnique email address that can be used for submitting documents for this Job default
9createdAti64default
11documentslist<document.Document>default
12jobUserslist<JobUser>default
13completedStepsi32default
14totalStepsi32default
15reasonCompletedstringdefault
16isPreviewboolPreview jobs are for authoring use before publishing default
17plannedStartAti64expected start date default
18startedAti640 if job in planning, else actual start date default
19creatorIdstringdefault
20metadataByIdmap<string, metadata.MetadataEntry>default
21meshEnabledbooldefault
22startAutoboolIf true then will start job automatically on planned start at optional
23jobTypeJobTypedefault
24usingEventsbooldefault
25srcmessaging.JobPtrIf JobType is Issue, optionally specify a source of the issue.
If job is an instance started from an AdHoc (on-demand) job, specify the source job.
Currently, only accepting references down to the detail of a step/group.
optional
26archivedAti64default
27locationstringoptional
28plannedStartJobRoleIdslist<string>If JobType is AdHoc, this must be a non-empty, valid job role id list for the user starting an ad hoc job to be assigned the following roles. This is in addition to the roles already assigned to this user during planning. optional
29enableStepTrackingbooloptional
30archivedByuser.Useroptional
31canceledByuser.Useroptional
32canceledAti64default
33expiresAti64default
34expiresAfterSecondsi64optional
101completionCodeJobCompletionCodeoptional
102eligibleCompletionCodeIdslist<common.UUID>DEPRECATED If this job is a workflow job instance, then this list will define the valid completion codes on job completion. It is used to branch the workflow accordingly. Codes are sent by UUID, and retrieved thanks to dedicated completion code endpoints. optional

Base Job object

Struct: JobStats

KeyFieldTypeDescriptionRequirednessDefault value
1completedStepsi32default
2totalStepsi32default

Struct: JobActivity

KeyFieldTypeDescriptionRequirednessDefault value
1lastMessageAti64default
2lastMessageSeqIdi64default
3lastMessageTextstringdefault
4lastExecutionDataAti64default
5lastExecutionDataSeqIdi64default
6lastModifiedAti64default

Struct: JobDocument

KeyFieldTypeDescriptionRequirednessDefault value
1fromTemplatebooldefault
2documentdocument.Documentdefault

Struct: JobRecurringRule

KeyFieldTypeDescriptionRequirednessDefault value
1ruleschedule.RecurringRuleThe rule for when you want the job to recur default
2startImmboolTrue if you want to start immediately optional

Struct: RecurredJobInfo

KeyFieldTypeDescriptionRequirednessDefault value
1recurringJobIdstringdefault
2recurringRuleJobRecurringRuledefault

KeyFieldTypeDescriptionRequirednessDefault value
1issueIdstringdefault
2srcPtrmessaging.JobPtrPoints to the job element the issue was created from default
3memberIdsset<string>Lists the users who belong to this issue. NOTE: this is not used by mobile and events default
4issueTitlestringName of the issue default
5issueCreatorIdstringUserId of the creator default
6issueCreatedAti64CreatedAt timestamp of the issue default
7lookupIdstringhuman readable identifier optional
8priorityPriorityLevelpriority of the issue optional

Represent an issue whose src points to an element in this job.
Note: when adding fields, remember to add corresponding field in IssueLinkOp

Struct: JobDeviationRef

KeyFieldTypeDescriptionRequirednessDefault value
1deviationStepGroupIdstringoptional
2deviationStepIdstringoptional
3deviationStepFieldIdstringoptional
4deviationFieldTriggerIdstringoptional
5deviationIdstringoptional
11sourceStepGroupIdstringoptional
12sourceStepIdstringoptional
13sourceTemplateIdstringoptional
14sourceTemplateVersioni32optional
15templateIndexi32optional
16hierarchyPositionstringoptional

A combination of ids are used based on deviation type

Struct: JobModular

KeyFieldTypeDescriptionRequirednessDefault value
1idstringJob UUID default
2titlestringdefault
3jobTemplateIdstringdefault
4jobTemplateInternalVersioni32default
5teamIdstringdefault
6completedAti64default
7reasonCompletedstringdefault
8createdAti64default
9updatedAti64default
10isPreviewboolPreview jobs are for authoring use before publishing default
11documentEmailAddressstringUnique email address that can be used for submitting documents for this Job default
12plannedStartAti64expected start date default
13startedAti640 if job in planning, else actual start date default
14creatorIdstringdefault
15metadataByIdmap<string, metadata.MetadataEntry>default
16meshEnabledbooldefault
17recurringRuleJobRecurringRuleThis will be filled in for the recurring job seed optional
18recurredInfoRecurredJobInfoThis will be filled in for the job which was created from the seed optional
19scheduleschedule.Schedulethe associated schedule instance for recurring job seeds optional
20startAutoboolIf true then will start job automatically on planned start at optional
21jobTypeJobTypedefault
22usingEventsbooldefault
23srcmessaging.JobPtrIf JobType is Issue, optionally specify a source of the issue.
If job is an instance started from an AdHoc (on-demand) job, specify the source job.
Currently, only accepting references down to the detail of a step/group.
optional
24lookupIdstringThis field will be populated with a human readable globally unique identifier. This idenfitier will have the format <Job|Issue>-<number> (current) <team_domain>-<j|i>-<number> (legacy) optional
25priorityPriorityLeveloptional
26archivedAti64default
27locationstringoptional
28plannedStartJobRoleIdslist<string>If JobType is AdHoc, this must be a non-empty, valid job role id list for the user starting an ad hoc job to be assigned the following roles. This is in addition to the roles already assigned to this user during planning. optional
29startedByuser.Useroptional
30completedByuser.Useroptional
31archivedByuser.Useroptional
32canceledByuser.Useroptional
33canceledAti64default
34expiresAti64default
35expiresAfterSecondsi64optional
101teamteam.TeamModularoptional
102jobTemplatejob_template.JobTemplateModularoptional
103rootHeadersgroup_headers.StepGroupHeadersdeprecated since multiple templates can be applied to a job optional
104stepGroupstep.BaseStepoptional
105documentslist<document.Document>deprecated in favor of jobDocuments optional
106jobUserslist<JobUser>optional
107statsJobStatsoptional
108activityJobActivityoptional
109templateslist<job_template.JobTemplateModular>supercedes jobTemplate optional
110creatoruser.Useroptional
111roleslist<job_role.JobRole>optional
112jobDocumentslist<JobDocument>optional
113permissionsjob_role.JobPermissionsthe union of the current user's role permissions for the job optional
114messageslist<messaging.Message>optional
115snippetslist<ExecutionSnippet>optional
116issueslist<IssueJobLink>optional
117deviationCountsmap<JobDeviationType, i32>no entry for type with 0 deviations optional
118deviationsmap<JobDeviationType, list<JobDeviationRef>>no entry for type with 0 deviations optional
119attributeslist<abac.AbacAttribute>optional
120completionCodeJobCompletionCodeoptional
121eligibleCompletionCodeIdslist<common.UUID>DEPRECATED If this job is a workflow job instance, then this list will define the valid completion codes on job completion. It is used to branch the workflow accordingly. Codes are sent by UUID, and retrieved thanks to dedicated completion code endpoints. optional
125referencesmap<reference.RefSource, set<string>>optional
126enableStepTrackingbooloptional

Struct: CompleteOpts

KeyFieldTypeDescriptionRequirednessDefault value
1completionCodecompletion_code.CompletionCodeoptional
2reasonstringoptional
3completedAti64optional

Struct: JobSelectOpts

KeyFieldTypeDescriptionRequirednessDefault value
1includeTeambooldefault
2includeTemplatebooldefault
3includeRootHeadersboolincludeRootHeaders is no longer functional since support of multi-template jobs has been implemented default
4includeStepsbooldefault
5includeDocumentsbooldefault
6includeUsersbooldefault
7includeStatsbooldefault
8includeActivitybooldefault
9includeTemplatesbooldefault
10includeCreatorbooldefault
11includeRolesbooldefault
12includePermissionsbooldefault
13includeExecSnippetsbooldefault
14includeMessagesbooldefault
15includeIssuesbooldefault
16includeDeviationCountsbooldefault
17includeDeviationsbooldefault
25includeRefMapbooldefault
30includePlannedDataSheetIdsboolOnly valid when job is still in planning default
31includeSnapshottedDataSheetValuesboolOnly valid when job has started default
32includeAttributesbooldefault

Union: JobFetchResult

KeyFieldTypeDescriptionRequirednessDefault value
1jobJobModulardefault
2errcommon.SystemExceptiondefault

Return type for Fetch. Either a valid JobModular result or an error

Struct: JobTextSearch

KeyFieldTypeDescriptionRequirednessDefault value
1querystringdefault

Struct: JobWhereOpts

KeyFieldTypeDescriptionRequirednessDefault value
1teamIdstringoptional
2userIdstringIf not self, teamId required. optional
3isCompletebooloptional
4isPreviewbooloptional
5isStartedbooloptional
6txtJobTextSearchoptional
7templateMetadatalist<metadata.MetadataEntry>See MetadataValue for specific metadata filter criteria optional
8creatorIdstringIf not self, teamId required. Will yield a positive match only for the creator of the job optional
9plannerIdstringIf not self, teamId required. Will match jobs where the plannerId == the userId of ANY of job planners belonging to that job optional
10jobMetadatalist<metadata.MetadataEntry>optional
11modifiedSinceTimei64optional
12modifiedBeforeTimei64optional
13includeRecurringJobsbooloptional
14jobTypesset<JobType>If set, will only include the selected JobTypes, and will override includeRecurringJobs If unset, will not include issues, and abide by includeRecurringJobs optional
15archivedOnlyboolIf set to true, will only include archived jobs If set to false, will include all jobs If unset (default), will only include unarchived jobs optional
16minCreatedAti64Allow users to filter jobs by their createdAt timestamp optional
17maxCreatedAti64optional
18startedSinceTimei64optional
19startedBeforeTimei64optional
20pageReqcommon.PageReqoptional
21sourceTemplateIdslist<string>optional
22prioritieslist<i32>For issues only, must only use issue job type in jobTypes optional
23srcJobIdslist<string>For issues only, must only use issue job type in jobTypes optional
24completedSinceTimei64optional
25completedBeforeTimei64optional
26teamIdslist<string>Overrides teamId when set: queries across teams user has admin permission on optional
27allUserTeamsboolOverrides teamIds and teamId when set:
Queries across ALL teams user has permissions on
This includes admin permissions for all jobs and
executor permissions for on demand jobs
optional
28allSourceTemplateIdsboolWhen set to true, jobs matched must contain all `sourceTemplateIds` defined. By default, they are multi-select, i.e. jobs with any of `sourceTemplateIds` are matched. optional
29attributeslist<abac.AbacAttribute>allows job filtering by attributes optional
30canceledOnlyboolIf set to true, will only include canceled jobs If set to false, will include all jobs If unset (default), will only include uncanceled jobs optional

Returns currentUser's jobs by default (teamId/userId unset). If teamId set, returns all jobs for that team. If teamId and userId set, returns all jobs for that team containing that user. If templateMetadata or jobMetadata is set, teamId must be set.

Struct: JobOrder

KeyFieldTypeDescriptionRequirednessDefault value
1fieldJobOrderBydefault
2ascbooldefaulttrue

Struct: JobQueryResult

KeyFieldTypeDescriptionRequirednessDefault value
1jobslist<JobModular>default
2pageInfocommon.PageInfooptional

Struct: JobQueryUpdatedResult

KeyFieldTypeDescriptionRequirednessDefault value
1timestampi64default
2jobslist<JobModular>default
3removedJobIdslist<string>default

Struct: JobFilterQueryOpts

KeyFieldTypeDescriptionRequirednessDefault value
1selectOptsJobSelectOptsoptional
2orderlist<JobOrder>optional
3pageReqcommon.PageReqoptional
4titlestringoptional
5tzLocationstringClient IANA time zone location, e.g. "America/Los_Angeles", defaults to "UTC" optional
6tzOffseti64Client time zone offset, in seconds east of UTC; only used when tzLocation is unset optional

Additional options to override the filter's stored selectOpts, order and to request for pagination when querying.

Services

Service: JobService

Function: JobService.query

JobQueryResult query(JobSelectOpts selectOpts,
                     JobWhereOpts whereOpts,
                     list<JobOrder> order)
    throws common.SystemException
Query a list of Jobs

Function: JobService.queryWithFilter

JobQueryResult queryWithFilter(string filterId,
                               JobFilterQueryOpts opts)
    throws common.SystemException
Query a list of Jobs using a stored custom filter

Function: JobService.queryUpdated

JobQueryUpdatedResult queryUpdated(JobSelectOpts selectOpts,
                                   i64 lastUpdated,
                                   set<JobType> jobTypes)
    throws common.SystemException
Query a list of Jobs that have been changed since the lastUpdated time If lastUpdated == 0, then same as calling query(). The call will result the same as calling query() with JobWhereOpts all default values. (i.e. all the jobs you belong too that have been started, previews that haven't been closed, etc. )

Function: JobService.fetch

map<string, JobFetchResult> fetch(JobSelectOpts selectOpts,
                                list<string> jobIds)
    throws common.SystemException
Fetch a specific list of Jobs.

Each element in the jobIds list must be either
1) A job uuid OR
2) A job lookupId in the format of <team-domain>-j-<lookup-id> for jobs and <team-domain>-i-<lookup-id> for issues
The keys in the return value will be either job uuids or unique lookupId identifiers depending on what was passed in.

Function: JobService.createBlank

JobModular createBlank(string teamId,
                       JobParams params,
                       list<abac.AbacAttribute> attributes)
    throws common.SystemException
Create a job with a blank (empty) template; returned struct has all non-empty components filled in.

Function: JobService.instantiateRecurringJob

JobModular instantiateRecurringJob(string jobId)
    throws common.SystemException
Use this function to instantiate a new 'copy' of the recurring job. This is basically to force create it outside of the normal recurring flow

Function: JobService.retryRecurringJob

void retryRecurringJob(string jobId)
    throws common.SystemException
Force run any pending instances of this recurring job. If the recurring job has been paused due to many errors, it will unpause and retry. Will throw an error if something goes wrong

Function: JobService.updateRecurringRule

JobModular updateRecurringRule(string jobId,
                               JobRecurringRule recurringRule)
    throws common.SystemException
Update the schedule at which the job will be created

Function: JobService.createPreview

Job createPreview(string templateId,
                  JobParams params)
    throws common.SystemException
Create a preview job

Function: JobService.createModular

JobModular createModular(JobModularParams params)
    throws common.SystemException

Function: JobService.addTemplates

JobModular addTemplates(string jobId,
                        list<string> templateIds,
                        i32 position)
    throws common.SystemException
Add templates to a job (when in planning); position to add before, -1 to add at end

Function: JobService.cloneTemplate

JobModular cloneTemplate(string jobId,
                         string templateJobBaseStepId,
                         i32 position)
    throws common.SystemException
Clone a template already inside a job (use the jobBaseStepId of the template). The job needs to be started Note : It will copy any added steps, and it will use the same template version even if the template was updated It literally is a clone of the template hierarchy currently in the job

Function: JobService.multiActionTemplates

JobModular multiActionTemplates(string jobId,
                                list<common.ListActions> movements)
    throws common.SystemException
Set full list of templates on a job. This replaces the need for consecutive api calls when moving, removing, editing and adding templates
To add a template with data sheet definition references, use AddAction with extraInfo set to the data sheet set id -> data sheet id map
To edit a template's data sheet selections on a job in planning state, use EditAction with extraInfo set to the updated data sheet set id -> data sheet id map; note that you cannot edit a template on a started job

Function: JobService.multiAddTemplates

JobModular multiAddTemplates(string jobId,
                             list<common.AddAction> adds)
    throws common.SystemException
Add multiple templates to an active job.

Function: JobService.addStep

Job addStep(string jobId,
            string parentJobBaseStepId,
            step.BaseStep step,
            i32 position)
    throws common.SystemException
Add a step to a job.

Function: JobService.addStepGroup

Job addStepGroup(string jobId,
                 string parentJobBaseStepId,
                 step.BaseStep step,
                 i32 position)
    throws common.SystemException
Add a step group to a job

Function: JobService.cloneStep

Job cloneStep(string jobId,
              string parentJobBaseStepId,
              string stepId,
              i32 position)
    throws common.SystemException
Clone a step in a job

Function: JobService.cloneJobStepGroup

Job cloneJobStepGroup(string jobId,
                      string parentJobBaseStepId,
                      string jobBaseStepGroupId,
                      i32 position)
    throws common.SystemException
Clone a step group along with changes that were made to it

Function: JobService.addDocument

Job addDocument(string jobId,
                string documentId)
    throws common.SystemException
Add a document to a Job

Function: JobService.updateDocumentPosition

Job updateDocumentPosition(string jobId,
                           string documentId,
                           i32 position)
    throws common.SystemException
Update a document position to a Job

Function: JobService.removeDocument

Job removeDocument(string jobId,
                   string documentId)
    throws common.SystemException
Remove a document from a job

Function: JobService.addUser

Job addUser(string jobId,
            string userId,
            string email,
            string jobRoleId)
    throws common.SystemException
Add a user to a job. To add a user by userId, send email as an empty string. To add a user by email, send userId as empty string. NOTE: If you add a non-existing user by email to a team located in a regional datacenter, the user is included in the result with sentinel value for the id. This is because a routine is kicked off that asynchronously requests the user to be provisioned in the global datacenter, waits for the user to sync over and then fires off a beacon notification. The sentinel value is a UUID with all 0s.

Function: JobService.archiveUser

void archiveUser(string jobId,
                 string userId,
                 string roleId)
    throws common.SystemException
Archive a user's role in a job. Archive all of a user's roles by passing "" to roleId.

Function: JobService.updateMetadata

map<string, metadata.MetadataEntry> updateMetadata(string jobId,
                                                 map<string, metadata.MetadataValue> updated,
                                                 list<string> removedIds)
    throws common.SystemException
Update the metadata (parameters) on a job. Updated are the values to be added or updated on the job. RemovedIds are the IDs of the values to be removed from the job.

Function: JobService.sendExecData

i64 sendExecData(string jobId,
                 list<ExecutionSnippet> execSnippets)
    throws common.SystemException
(Recommend using sendExecDataWithResult) Send all types of execution data. Returns the maximum seqId of the execution data created.

Function: JobService.sendExecDataWithResult

SendDataResult sendExecDataWithResult(string jobId,
                                      list<ExecutionSnippet> execSnippets)
    throws common.SystemException
Send all types of execution data. Returns a SendDataResult which includes the maximum seqId of the execution data created, AND the execution data with IDs filled in, both seqIds and pending document IDs. Supports async document upload with pending IDs allocated inline.

Function: JobService.getData

GetDataResult getData(string jobId,
                      i64 seqId,
                      GetDataOptions options)
    throws common.SystemException
Get Execution Data for a Job Send the last seqId received as an argument, to get everything > that value

Function: JobService.complete

void complete(string jobId,
              string reason)
    throws common.SystemException
(DEPRECATED, use completeWithOpts) Mark the job completed - since a completion code cannot be supplied, the team's default code will be used when this method is invoked

Function: JobService.completeWithOpts

void completeWithOpts(string jobId,
                      CompleteOpts opts)
    throws common.SystemException
Mark the job completed with options

Function: JobService.uncomplete

void uncomplete(string jobId)
    throws common.SystemException
Mark the job not completed

Function: JobService.updateJob

Job updateJob(string jobId,
              JobParams params)
    throws common.SystemException
Update job details

Function: JobService.start

void start(string jobId)
    throws common.SystemException
Complete planning stage; before this is called, execution data may not be recorded

Function: JobService.instantiateAdHocJob

JobModular instantiateAdHocJob(string jobId)
    throws common.SystemException
Instantiate a new instance of an ad hoc job
After starting a new normal job based on this ad hoc job,
the ad hoc job itself does not change state.
Returns the instantiated active job with pre-planned roles assigned to the executor.

Function: JobService.getPriorityLevels

list<PriorityLevel> getPriorityLevels(string teamId)
    throws common.SystemException
Fetch available priority levels, and their titles, returned in priority order highest to lowest

Function: JobService.archive

JobModular archive(string jobId)
    throws common.SystemException
Mark a job as archived. Can only archive completed and canceled jobs.

Function: JobService.unarchive

JobModular unarchive(string jobId)
    throws common.SystemException
Mark a job as unarchived. Reverts job back to its previous state.

Function: JobService.updateAttributes

list<abac.AbacAttribute> updateAttributes(common.UUID jobId,
                                          list<abac.AbacAttribute> attributes)
    throws common.SystemException
Clobber all job attributes with the provided map

Function: JobService.updateAttributesRestricted

abac.AbacUpdateAttributeResult updateAttributesRestricted(common.UUID jobId,
                                                          list<abac.AbacAttribute> attributes,
                                                          abac.AbacUploadBehaviour behave)
    throws common.SystemException
Update attributes on a job with restrictions Performs the same actions as updateAttributes, but with several safety checks. If a safety check fails, this function will skip the update, and return the current attribute state and an error object describing the safety violation param jobId: job to update param attributes: the new AttributeValues to associated with Attribute attributeId on job jobId param behave: determine the behaviour of the endpoint, merge or clobber. Default: clobber

Function: JobService.updateAttribute

list<abac.AbacAttribute> updateAttribute(common.UUID jobId,
                                         common.UUID attributeId,
                                         list<abac.AbacAttributeValue> values,
                                         abac.AbacUploadBehaviour behave)
    throws common.SystemException
Update a single attribute on a job returns the current attribute state of the job param jobId: job to update param attributeId: the AttributeId of the team level attribute to be updated param values: the new AttributeValues to associated with Attribute attributeId on job jobId param behave: determine the behaviour of the endpoint, merge or clobber. Default: clobber

Function: JobService.updateAttributeRestricted

abac.AbacUpdateAttributeResult updateAttributeRestricted(common.UUID jobId,
                                                         common.UUID attributeId,
                                                         list<abac.AbacAttributeValue> values,
                                                         abac.AbacUploadBehaviour behave)
    throws common.SystemException
Update a single attribute on a job with restrictions Performs the same actions as updateAttribute, but with several safety checks. If a safety check fails, this function will skip the update, and return the current attribute state and an error object describing the safety violation param jobId: job to update param attributeId: the AttributeId of the team level attribute to be updated param values: the new AttributeValues to associated with Attribute attributeId on job jobId param behave: determine the behaviour of the endpoint, merge or clobber. Default: clobber

Function: JobService.updateOfflineJobs

JobModular updateOfflineJobs(string jobId,
                             list<job_template.TemplateInfo> templateInfo,
                             list<step.StepInfo> stepInfo)
    throws common.SystemException
Bulk Update offline jobs by addig templates/steps/step groups return value will be the updated job param jobId: job to update param TemplateInfo: Contains information about the new template that was added param StepInfo: Contains information about the new stesps/step groups that were added

Function: JobService.cancel

JobModular cancel(string jobId)
    throws common.SystemException
Sets the job as canceled at the given time and by the current user. Can only cancel active and planned jobs. param jobId: job to cancel

Function: JobService.uncancel

JobModular uncancel(string jobId)
    throws common.SystemException
Restores the job to its original state: active or planned. param jobId: job to uncancel