> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# appmixer.teamwork.core.SetTaskCustomField

- Component: `appmixer.teamwork.core.SetTaskCustomField`
- Kind: Action
- Version: 1.0.0
- Visibility: Public
- Connector: [appmixer.teamwork 1.1.0](https://connectors.appmixer.com/connector/appmixer.teamwork/1.1.0.md)
- Component page: <https://connectors.appmixer.com/connector/appmixer.teamwork/1.1.0/component/appmixer.teamwork.core.SetTaskCustomField>

Set a custom field on a task in Teamwork.com

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| Task ID (`taskId`) | number | - |
| Custom Field (`customFieldId`) | select | - |
| Value (`checkboxValue`) | select | - |
| Value (`numberValue`) | number | - |
| Value changed from (`dropdownValue`) | select | - |
| Text (`textValue`) | text | - |
| Date (`dateOption`) | select | - |
| Date (yyyy-MM-dd) (`dateValue`) | text | - |
| Days after trigger (`dateDays`) | number | - |
| Offset (`taskDateOffset`) | number | - |
| Unit (`taskDateOffsetUnit`) | select | - |
| Direction (`taskDateOffsetDirection`) | select | - |
| Skip weekends (`skipWeekends`) | toggle | - |

## Output ports

### Port `task`

| Field | Type | Description |
| --- | --- | --- |
| Task ID (`taskId`) | - | - |
| Custom Field ID (`customFieldId`) | - | - |

## Full metadata (component.json)

```json
{
  "name": "appmixer.teamwork.core.SetTaskCustomField",
  "auth": {
    "service": "appmixer:teamwork"
  },
  "author": "sinead.cullinane@teamwork.com",
  "description": "Set a custom field on a task in Teamwork.com",
  "private": false,
  "version": "1.0.0",
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "taskId": {
            "type": "integer"
          },
          "customFieldId": {
            "type": "string"
          },
          "checkboxValue": {
            "type": "string"
          },
          "numberValue": {
            "type": "number"
          },
          "dropdownValue": {
            "type": "string"
          },
          "textValue": {
            "type": "string"
          },
          "dateOption": {
            "type": "string",
            "title": "Date is"
          },
          "dateValue": {
            "type": "string",
            "title": "Date (yyyy-MM-dd)"
          },
          "dateDays": {
            "type": "integer",
            "title": "Days after trigger"
          },
          "taskDateOffset": {
            "type": "integer",
            "title": "Offset"
          },
          "taskDateOffsetUnit": {
            "type": "string",
            "title": "Unit"
          },
          "taskDateOffsetDirection": {
            "type": "string",
            "title": "Direction"
          },
          "skipWeekends": {
            "type": "boolean",
            "title": "Skip weekends"
          }
        },
        "required": [
          "taskId",
          "customFieldId"
        ]
      },
      "inspector": {
        "inputs": {
          "taskId": {
            "index": 0,
            "type": "number",
            "label": "Task ID"
          },
          "customFieldId": {
            "index": 1,
            "type": "select",
            "label": "Custom Field",
            "source": {
              "url": "/component/appmixer/teamwork/core/ListCustomFields?outPort=customfields",
              "data": {
                "messages": {
                  "in/entity": "task"
                },
                "transform": "./ListCustomFields#toInspector"
              }
            }
          },
          "checkboxValue": {
            "when": {
              "regex": {
                "customFieldId": "^[0-9]+-checkbox$"
              }
            },
            "index": 2,
            "type": "select",
            "label": "Value",
            "options": [
              {
                "content": "Unchecked",
                "value": "false"
              },
              {
                "content": "Checked",
                "value": "true"
              }
            ]
          },
          "numberValue": {
            "when": {
              "regex": {
                "customFieldId": "^[0-9]+-number-.*"
              }
            },
            "index": 3,
            "type": "number",
            "label": "Value"
          },
          "dropdownValue": {
            "when": {
              "regex": {
                "customFieldId": "^[0-9]+-(dropdown|status)$"
              }
            },
            "index": 4,
            "type": "select",
            "label": "Value changed from",
            "source": {
              "url": "/component/appmixer/teamwork/core/ListCustomFields?outPort=options",
              "data": {
                "messages": {
                  "in/entity": "task"
                },
                "properties": {
                  "customFieldId": "inputs/in/customFieldId"
                },
                "transform": "./ListCustomFields#optionsToInspector"
              }
            }
          },
          "textValue": {
            "when": {
              "regex": {
                "customFieldId": "^[0-9]+-(text-|url).*"
              }
            },
            "index": 5,
            "type": "text",
            "label": "Text"
          },
          "dateOption": {
            "when": {
              "regex": {
                "customFieldId": "^[0-9]+-date$"
              }
            },
            "index": 6,
            "type": "select",
            "label": "Date",
            "options": [
              {
                "content": "On trigger date",
                "value": "on-trigger-date"
              },
              {
                "content": "Choose date",
                "value": "choose-date"
              },
              {
                "content": "Days after trigger date",
                "value": "days-after-trigger-date"
              },
              {
                "content": "Start date - from the task",
                "value": "start-date-from-task"
              },
              {
                "content": "Due date - from the task",
                "value": "due-date-from-task"
              },
              {
                "content": "Custom date field - from the task",
                "value": "custom-field-value-from-task"
              },
              {
                "content": "Remove date",
                "value": "remove-date"
              }
            ],
            "defaultValue": "on-trigger-date"
          },
          "dateValue": {
            "when": {
              "eq": {
                "dateOption": "choose-date"
              }
            },
            "index": 7,
            "type": "text",
            "label": "Date (yyyy-MM-dd)"
          },
          "dateDays": {
            "when": {
              "eq": {
                "dateOption": "days-after-trigger-date"
              }
            },
            "index": 8,
            "type": "number",
            "label": "Days after trigger"
          },
          "taskDateOffset": {
            "when": {
              "in": {
                "dateOption": [
                  "start-date-from-task",
                  "due-date-from-task",
                  "custom-field-value-from-task"
                ]
              }
            },
            "index": 9,
            "type": "number",
            "label": "Offset",
            "min": 0,
            "defaultValue": 1
          },
          "taskDateOffsetUnit": {
            "when": {
              "in": {
                "dateOption": [
                  "start-date-from-task",
                  "due-date-from-task",
                  "custom-field-value-from-task"
                ]
              }
            },
            "index": 10,
            "type": "select",
            "label": "Unit",
            "options": [
              {
                "content": "Day",
                "value": "day"
              },
              {
                "content": "Week",
                "value": "week"
              }
            ],
            "defaultValue": "day"
          },
          "taskDateOffsetDirection": {
            "when": {
              "in": {
                "dateOption": [
                  "start-date-from-task",
                  "due-date-from-task",
                  "custom-field-value-from-task"
                ]
              }
            },
            "index": 11,
            "type": "select",
            "label": "Direction",
            "options": [
              {
                "content": "Before",
                "value": "before"
              },
              {
                "content": "After",
                "value": "after"
              }
            ],
            "defaultValue": "after"
          },
          "skipWeekends": {
            "when": {
              "in": {
                "dateOption": [
                  "days-after-trigger-date",
                  "start-date-from-task",
                  "due-date-from-task",
                  "custom-field-value-from-task"
                ]
              }
            },
            "index": 12,
            "type": "toggle",
            "label": "Skip weekends",
            "defaultValue": false
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "task",
      "options": [
        {
          "label": "Task ID",
          "value": "taskId"
        },
        {
          "label": "Custom Field ID",
          "value": "customFieldId"
        }
      ]
    }
  ],
  "icon": "(data URI omitted)"
}
```
