Assign or remove a step from a work package, or assign a task to a work step, including volumetric (volume centric) work steps.
You can also generate work steps from the tasks assigned to a work package. The work steps are assigned to the work package.
Finding and specifying the work step type and inspection step type
The work step type is configured with an inspection step type, which determines how the step will be rendered in a Smart Form. When creating a Work Package Step, you must specify the ID for one of the types and the ID for the other type will be automatically assigned based on this relationship, as follows:
-
If you know the work step type, specify it using the WorkStepTypeId request payload parameter. The inspection step type ID will be automatically set.
-
Otherwise, specify the inspection step type using the InspectionTypeID request payload parameter. The work step type ID will be automatically set.
Finding and specifying the Task ID
When assigning a task to a work step, if you already know the task ID you can specify it using the TaskId request payload parameter.
Otherwise, you can use reverse look up the task ID using either:
-
The asset (tag) ID and document ID of the object that the task applies to (for example the asset, loop, pack). Specify the IDs using the AssetId and DocumentID request payload parameters.
-
The test form number of the task model. Note that:
-
This look up only works if each task model has its own unique form number.
-
If the object is associated with a work step but does not have an assigned task, the task will be assigned to the object and linked to the work package step at the same time.
-
-
If the task is created at a later date then the step should be automatically updated on task creation.
-
A task can only be assign to one work step, if the same task is assign to another work step, then the previous assignment is removed.
Linking a Smart Completions task to an external work step
In Smart Completions, an asset (tag) can be linked to more than one task. Therefore, if you need to link a Smart Completions task to an external work step, three properties must be provided in order to determine the correct task:
-
Test form number of the task
-
Work step type
-
Another unique value, such as the tagged object
Endpoint description
Supported HTTPS Methods: GET, PUT, PATCH, POST
Request URLs:
-
Assign a step to a work package or a task to a work step - <HOSTNAME>/sc/datalake/v1/Instances(2)/Projects(313)/WorkPackages(1020)/WorkPackagesSteps
-
Remove a step from a work package - <HOSTNAME>/sc/datalake/v1/Instances(2)/Projects(313)/Workpackages(1020)/WorkPackageSteps(9999)
Header parameters:
Header Parameter |
Description |
---|---|
Authorization |
A token required for authenticating a request. The bearer token is a string, usually generated by the server in response to a login request. You must include this header in every request. |
Content-Type |
The request format or the original media type of the resource. |
Sample request payload to assign a work step to a work package:
{
"WPId": 1024,
}
Sample request payload to remove a work step from a work package:
{
"dtRemoved": "2023-07-14T16:09:13-06:00"
}
Sample request payload to assign a work step to a work package using task ID:
{
"WPId": 1023,
"AssetId": 1663,
"FWCId" : "FWCId API test 01",
"FIWP" : "FIWP API test 01",
"TaskId" : 9671,
"StepTypeId" : 1,
"InspectionTypeId" : 148,
"OrderSequence" : 1.001,
"StepSequenceId" : 1,
"StepSequence" : "1",
"StepAction" : "a new task step from api"
}
Sample request payload to assign a work step to a work package using asset (tag) ID and document ID:
{
"WPId": 1021,
"AssetId": 1876,
"FWCId" : "FWCId-0004",
"FIWP" : "FIWP-API-test",
"DocumentId" : 8790,
"StepTypeId" : 1,
"InspectionTypeId" : 148,
"OrderSequence" : 4,
"StepSequenceId" : 4,
"StepSequence" : "4",
"StepAction" : "a new task step from api"
}
Sample request payload to create a volumetric work step:
{
"WPId": 1021,
"AssetId": 1876,
"FWCId" : "FWCId-0004",
"FIWP" : "FIWP-API-test",
"StepTypeId" : 1,
"InspectionTypeId" : 150,
"OrderSequence" : 4,
"StepSequenceId" : 4,
"StepSequence" : "4",
"StepAction" : "a new task step from api"
}
Request payload parameters:
|
|
Required, Optional, |
|
---|---|---|---|
WPId |
Integer |
GET - Optional PUT - Required PATCH - Required POST - Required |
ID of the work package that the step is being assigned to or removed from. |
AssetId |
Integer |
GET - Optional PUT - Optional PATCH - Optional POST - Required to look up the Task ID; Otherwise, unused |
Asset ID used to look up the ID of the task being assigned to the work step. To look up the task ID, you must also include DocumentID. |
FWCId |
String |
GET - Optional PUT - Optional PATCH - Optional POST - Optional |
Field work cell. Unique Tag Name per work step. |
FIWP |
String |
GET - Optional PUT - Optional PATCH - Optional POST - Optional |
Optional custom field. |
DocumentID |
Integer |
GET - Optional PUT - Optional PATCH - Optional POST - Required to look up the Task ID; Otherwise, unused |
Document ID used to look up the ID of the task being assigned to the work step. To look up the task ID, you must also include AssetId. |
TaskId |
Integer |
GET - Optional PUT - Optional PATCH - Optional POST - Required if not looking up the Task ID; Otherwise, unused |
ID of the task to assign to the work step. Options are chosen from the CCMSTask select list. |
StepTypeId |
Integer |
GET - Optional PUT - Optional PATCH - Optional POST - Required |
Value indicating the work step type, either:
|
InspectionTypeId |
Integer |
GET - Optional PUT - Optional PATCH - Optional POST - Required |
Inspection type for work step. Options are chosen from the WorkPackageInspectionTypeItem select list. |
OrderSequence |
Integer |
GET - Optional PUT - Optional PATCH - Optional POST - Optional |
Sequence used to order the work steps for display, from lowest to highest. |
StepSequenceId |
Integer |
GET - Optional PUT - Optional PATCH - Optional POST - Optional |
ID of the sequence used to order the work steps for execution. |
StepSequence |
String |
GET - Optional PUT - Optional PATCH - Optional POST - Optional |
Name of the sequence used to order the work steps for execution. |
StepAction |
String |
GET - Optional PUT - Optional PATCH - Optional POST - Optional |
Action to be performed with this step. |
dtRemoved |
String (Date) |
GET - Optional PUT - Required PATCH - Required POST - Unused |
Date on which the work step was removed from the work package. |
Response:
POST returns the newly-created record. PATCH and PUT return the confirmation update status 204.