Trying to write webhook to assign subtask to asignee in custom field in parent task

I am new to webhooks, so this may be user error. I am using the developers reference to write a webhook that creates a subtask and assigns the subtask to the assignee in a custom field in the parent task. Is there a way to do this? In the API reference page it only works if I add a specific user gid, but adding the gid of the custom field is not working.

Hi @Kaitlyn_Bryant,

First, I don’t think you mean “webhook”; you mean you are writing some code that calls some of the endpoints in the Asana API, right? “Webhooks” are a specific piece of the Asana API that send notifications to an external app of changes in Asana, and from your description, you’re not utilizing that piece.

I’ll proceed assuming the above is correct and you’re not using webhooks but are using some of the endpoints that create/update tasks.

Right; the gid you put in an Assignee field has to be a user gid. What type of custom field are you using to store the user info? A text field, a dropdown list, or a People field? In any of those cases, you’ll need to take what’s in the custom field and translate it to a user gid, but if you tell me the type of field and what data you’re putting in it, I can likely provide further guidance.

(Also as an FYI, I don’t know if it would help in your scenario but we already provide rule actions in our Flowsana integration that do what you’re trying to do, in case that might help you from having to code it yourself.)