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.
On 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.
If 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.
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.
If 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.
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
15
plannedDataSheetIdsList
list<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
16
enableStepTracking
bool
optional
17
expiresAt
i64
optional
18
expiresAfterSeconds
i64
optional
20
enableMesh
bool
optional
30
dupJobId
string
Job to duplicate from, currently only template ref values are being copied over, skipping the need for validation and reducing traffic
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.
For 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
If 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
26
archivedAt
i64
default
27
location
string
optional
28
plannedStartJobRoleIds
list<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.
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.
If 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
24
lookupId
string
This 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)
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.
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.
If set, will only include the selected JobTypes, and will override includeRecurringJobs
If unset, will not include issues, and abide by includeRecurringJobs
optional
15
archivedOnly
bool
If 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
16
minCreatedAt
i64
Allow users to filter jobs by their createdAt timestamp
For issues only, must only use issue job type in jobTypes
optional
23
srcJobIds
list<string>
For issues only, must only use issue job type in jobTypes
optional
24
completedSinceTime
i64
optional
25
completedBeforeTime
i64
optional
26
teamIds
list<string>
Overrides teamId when set:
queries across teams user has admin permission on
optional
27
allUserTeams
bool
Overrides 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
28
allSourceTemplateIds
bool
When 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.
If 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.
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. )
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.
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
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
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
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.
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.
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.
(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
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.
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
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
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
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