Environment
TeamDynamix, iPaaS, JSON
Issue
Information about how to update and modify TeamDynamix tickets and related assets.
Resolution
Flow name: flow:patch_asset_and_ticket
This flow requires a single asset to be attached to the ticket the TeamDynamix workflow is running against.
How to use
- From within a TeamDynamix workflow, create a new step with the type ‘TeamDynamix iPaaS’.
- Name the workflow step.
- Choose ‘flow:patch_asset_and_ticket’ in the iPaaS Flow field.
- Choose ‘Latest Published Version’ in the iPaaS Flow Version field.
- See example code snippets below for acceptable values for the Additional Arguments JSON field.
- Check the ‘Wait for Results’ checkbox.
- Click the ‘Add Result’ button and type ‘FlowFailure’ in the Result field that appears.
- This will allow for additional logic to be built into the workflow if the iPaaS flow fails either because the passed status couldn’t be found or a passed user could not be added as a contact.
- Save the workflow step and connect it in the workflow.
It is best practice to use matching attribute types when patching between tickets and assets when utilizing attributes. This means that to update a dropdown box, it is best to take the values from a matching dropdown box. However, it is also possible to use static values within the workflow json to patch either asset or ticket.
Certain fields will only accept choice IDs as valid input when patching with static json from workflow. Currently, Location, Location room, and Asset attribute types will only accept valid IDs as static values. It is still possible to patch from one of those fields to the same type between asset and ticket.
Built-in attributes can be accessed by name as they appear in the TeamDynamix api documentation below.
Order of operations:
- Asset patch
- Ticket patch
flow:patch_asset_and_ticket accepted values
Asset
|
JSON Keyword
|
Description
|
Accepted Value
|
Notes
|
“op”
|
The operation to be performed during the patch.
|
“add”
“remove”
“replace”
|
For changing a field that already has a value, use ‘replace’. To put a value in an empty field, ‘add’ or ‘replace’ will be acceptable. To remove a value from a field and leave it blank, use ‘remove’.
|
“asset_dest”
|
The asset field that will be patched with the op action.
|
{{customID}} {{apiFieldName}}
|
{{customID}} can be any custom asset ID.
{{apiFieldName}} can be any built-in attribute name identified in the api asset documentation in the link above.
|
“ticket_src”
|
The form field that contains the information that will be patched to the asset.
|
{{customID}} {{apiFieldName}}
|
{{customID}} can be any custom attribute ID.
{{apiFieldName}} can be any built-in attribute name identified in the api documentation. Please note that this field should contain an acceptable value for the asset field to be updated. If the asset field is a choice field, make sure to use one of the choices from the asset, other values will not be entered into the field.
|
Ticket
|
JSON Keyword
|
Description
|
Accepted Value
|
Notes
|
“op”
|
The operation to be performed during the patch.
|
“add”
“remove”
“replace”
|
For changing a field that already has a value, use ‘replace’. To put a value in an empty field, ‘add’ or ‘replace’ will be acceptable. To remove a value from a field and leave it blank, use ‘remove’.
|
“ticket_dest”
|
The ticket field that will be patched with the op action
|
{{customID}} {{apiFieldName}}
|
{{customID}} can be any custom ticket ID. {{apiFieldName}} can be any built-in attribute name identified in the api ticket documentation.
|
“asset_src”
|
The asset field that contains the information that will be patched to the ticket.
|
{{customID}} {{apiFieldName}}
|
{{customID}} can be any custom asset ID. {{apiFieldName}} can be any built-in attribute name identified in the api documentation. Please note that this field should contain an acceptable value for the ticket field to be updated. If the ticket field is a choice field, make sure to use one of the choices from the ticket, other values will not be entered into the field.
|
Examples
Update asset field (2240) with the value from ticket field (11035), then update the ticket from ticket field (11036) with value from asset field (2240).
{
"asset": [
{
"op": "replace",
"asset_dest": "{{2240}}",
"ticket_src": "{{11035}}"
}
],
"ticket": [
{
"op": "replace",
"asset_src": "{{2240}}",
"ticket_dest": "{{11035}}"
}
]
}
Update multiple asset fields from ticket fields and update a single ticket field
{
"asset": [
{
"op": "replace",
"asset_dest": "{{SerialNumber}}",
"ticket_src": "{{112233}}"
},
{
"op": "replace",
"asset_dest": "{{2240}}",
"ticket_src": "{{113322}}"
},
{
"op": "replace",
"asset_dest": "{{10045}}",
"ticket_src": "{{RequestorName}}"
}
],
"ticket": [
{
"op": "replace",
"asset_src": "{{2240}}",
"ticket_dest": "{{11035}}"
}
]
}
Update asset status using status id
{ "asset": [
{
"op": "replace",
"asset_dest": "{{StatusID}}",
"ticket_src": "10"
}
]
}
Additional Information
Need additional information or assistance? Submit a request here: ITS-TeamDynamix Support.