Hi there,
I havent solved the issue just yet, but as requested Ill paste in the relevant code blocks:
URL and method: PATCH https://api.hubapi.com/automation/v4/actions/{{appId}}/{{actionId}}?hapikey={{developerKey}} -- For testing a POST to create works too.
Body:
{
“actionUrl”: “https://139735294.hs-sites-eu1.com/_hcms/api/create-project”,
“objectTypes”: [
“DEAL”
],
“published”: true,
“inputFields”: [
{
“typeDefinition”: {
“name”: “dealName”,
“type”: “string”
},
“supportedValueTypes”: [
“OBJECT_PROPERTY”
],
“isRequired”: true
},
{
“typeDefinition”: {
“name”: “dealId”,
“type”: “string”
},
“supportedValueTypes”: [
“OBJECT_PROPERTY”
],
“isRequired”: true
}
],
“labels”: {
“en”: {
“actionName”: “Create Jira Project”,
“actionDescription”: “This action will create a new Jira project”,
“actionCardContent”: “Create Jira Project {{dealName}}”,
“inputFieldLabels”: {
“dealName”: “Deal Name”,
“dealId”: “Deal ID”,
“jiraProjectId”: “Jira Project ID”
},
“inputFieldDescriptions”: {
“dealName”: “Insert the Deal Name field property”,
“dealId”: “Insert the Deal ID field property”,
“jiraProjectId”: “Insert the Jira Project ID field property”
}
}
},
“outputFields”: [
{
“typeDefinition”: {
“name”: “jira_project_id”,
“type”: “string”,
“fieldType”: “text”
}
}
],
“functions”: [
{
“functionType”: “POST_ACTION_EXECUTION”,
“functionSource”: “exports.main = (event, callback) => {\r\n callback({\r\n outputFields: {\r\n jira_project_id: \“example output value\”\r\n }\r\n });\r\n}”
}
]
}
Response:
{
“actionUrl”: “https://139735294.hs-sites-eu1.com/_hcms/api/create-project”,
“published”: true,
“inputFields”: [
{
“typeDefinition”: {
“name”: “dealName”,
“type”: “string”,
“fieldType”: null,
“options”: [],
“optionsUrl”: null,
“referencedObjectType”: null,
“externalOptions”: false,
“externalOptionsReferenceType”: null
},
“supportedValueTypes”: [
“OBJECT_PROPERTY”
],
“isRequired”: true,
“automationFieldType”: null
},
{
“typeDefinition”: {
“name”: “dealId”,
“type”: “string”,
“fieldType”: null,
“options”: [],
“optionsUrl”: null,
“referencedObjectType”: null,
“externalOptions”: false,
“externalOptionsReferenceType”: null
},
“supportedValueTypes”: [
“OBJECT_PROPERTY”
],
“isRequired”: true,
“automationFieldType”: null
}
],
“objectRequestOptions”: null,
“labels”: {
“en”: {
“inputFieldLabels”: {
“dealName”: “Deal Name”,
“dealId”: “Deal ID”
},
“inputFieldDescriptions”: {
“dealName”: “Insert the Deal Name field property”,
“dealId”: “Insert the Deal ID field property”
},
“actionName”: “Create Jira Project”,
“actionDescription”: “This action will create a new Jira project”,
“actionCardContent”: “Create Jira Project {{dealName}}”
}
},
“objectTypes”: [
“0-3”
],
“outputFields”: [
{
“typeDefinition”: {
“name”: “jira_project_id”,
“type”: “string”,
“fieldType”: “text”,
“options”: [],
“optionsUrl”: null,
“referencedObjectType”: null,
“externalOptions”: false,
“externalOptionsReferenceType”: null
}
}
],
“id”: “41458696”,
“revisionId”: “14”,
“functions”: []
}
As you can see I have inserted “functions” on my body request yet the answer comes back as an empty array.