Question

ClickUp: Accessing value of custom field in task parent


Hi group. This question is related to ClickUp.

I managed to create a Zap that is triggered when a task changes it status to complete, and have the Zap produce an e-mail that contains values from custom fields the completed task has.

I then also managed to add a Filter by Zapier to create an If condition so the event would only result in the email in case the tasks had a specific name.

 

What I want to do now is to access the value of custom field that the parent of the task has for the E-mail. I haven’t managed to find how to do that by searching.


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

11 replies

Userlevel 7
Badge +11

Hey there @crabbymosavi! 🙂  

I’ve not tested this but in theory if you’re able to get the ID of the parent task from the ClickUp trigger then you should be able to use that in a Find Task by ID (ClickUp) search action to locate the parent task. Then that should allow you to access the value in the parent task’s custom field.

My guess is that you’d be looking for a field called Parent ID, or something similar. I’d suggest taking a closer look at the sample tasks in your Zap to see if there’s a field that contains the parent task’s ID? You may need to change the test data in the Zap in order to pull in a task that has a parent. Otherwise it might not be able to see a Parent ID field if the task doesn’t have a parent. 

Can you give that a try and let us know whether that works as hoped? 

Hi SamB and thanks for the response.

I didn’t get as far as testing Find Task by ID yet. I wasn’t able to find a Parent ID, but did find a “Parent”.

I run it through a “Run Javascript in Code by Zapier” with the following input data:

 

The issue is that when I reference that value, I get something that isn’t in the same format as a task ID:

 

 

I’m probably missing something or doing something wrong.

The email that is sent gets this: 
 

 

The value on the second row isn’t a valid task ID as far as I know

Userlevel 7
Badge +12

Hi @crabbymosavi!

Hmm, this is a strange one.

I looked through examples of data we get from the Task changes trigger and the ‘parent’ field was “null” in all the samples I can see. Sometimes there’s a ‘parent_id’ field, but it only shows when there’s an attachment on the task, so it may be the ID of the task the attachment is on? It’s a little tricky to tell from the sample data I found. 

I can see that there is an unresolved bug around information coming through on the Task changes, I’m not sure if it’s affecting all users or just some. I recommend getting in touch with the Support Team (using the Get Help form) as they can look at the Zap runs for your Zap to see exactly what information is or isn’t coming through. 

I hope that helps!

Hi Danvers. I’ve sent the Support Team a message using your link, referring to this thread for describing the issue

I’ll repeat the issue: I get a number when I run the Zap that is supposed to aquire the parent ID , but that parent ID isn’t in the format that the parent task ID is. I get:

  • 4vvZ4pwHqXqok7o7kvCL3m3ILpLNHT3J

When I should be getting: 

  • #865bqxt12

The first value was email to me by the Zap, the second value was acquired using this:

 

 

Hi all.

It looks like I wasn’t able to communicate the issue while being brief, so I’ll make a long and possibly too detailed explanation of the issue here.


Before Zapier

On ClickUp, there is one task:

  • Name: MainTask_Test
  • ID: #865bqxt12

That task has a subtask:

  • Name: SubTask1_Test
  • ID: #865bqxt6e

 

I received the ID by clicking here:

 

The ID is then copied to the clipboard and can be viewed by pasting it on notepad.

So far all is good.

Zapier setup

The zap is set up in the following way:

It has three parts:

The first part:

 

The Zap is set to react when a task is set to complete.

Now, a clarification. I am not interested in MainTask_Test being set to complete, I’m only intrested in SubTask1_Test being set to complete.. I know how to filter out a task by name, but haven’t done so for the sake of simplicity.

Here is the complexity:

FYI, SendGrid is a website that provides the service of sending emails in your name to whoever you specify.

The recipient of the email is specified in a custom field in MainTask_Test. That value is not present in any of the custom fields of SubTask1_Test.

Now, when SubTask1_Test triggers, I need to:

  1. Get the ID of MainTask_Test
  2. Use that ID to find MainTask_Test itself
  3. Access the custom fields of MainTask_Test in order to find the recipient of the email

 

Part two of the Zap looks like this:

 

What it does is create a variable amonng the input data named “parentData” and fills the data with the Parent of the task.

As can be seen in the picture, that datas value is “No data”. The reason for that is that the zap, now in it’s design phase, is set to get its values from MainTask_Test and not SubTask1_Test.

Why is that? Because Zapier in its current state does not detect subtasks. I don not know if this is by design or omission, but that’s how it is. There is only two tasks in that entire ClickUp (test) account, so not being able to select SubTask1_Test leaves me no choice other than select MainTask_Test. To document that being the case:

 

 

 

And again, in ClickUp:

 

(I’ll send in this respons this far for fear of losing what I’ve written so far, second part incomming soon)

 

 

 

 

Going back to the Zapier Code:

I have now explained why “Task Parent” has no data. It correctly identifies that MainTask_Test has no parent.

I then, in code, take that input variable (that is representing the parent of the current task) and take its ID.

While the current task is MainTask_Test, the parent is supposed to be, well, nothing.

While the current task is SubTask1_Test, the parent is supposed to be MainTask_Test.

The current task is the task that triggered the Zap in the first place, as specified higher up in the response, by having it’s status being changed to “Complete”

 

When current task is SubTask1_Test, its “Task Parent” is expected to be MainTask_Test, with the ID #865bqxt12 as correctly identified by Zapier earlier:

 

Writing this in detail like this, the issue might be here. I would suggest the support team to look into if “Task Parent” is actually what it’s expected to be. It wasn’t possible for me to check this, since Zapier didn’t detect SubTask1_Test, as explained above.

 

For the last part, SendGrid is set up like this:

(Skipping to relevant part)

 

Now, if I run this by changing the status of MainTask_Test to “Complete” I get no email.

I know “I get no email” because I have a separate Zap (in another Zapier account) that reacts on the status change and sends an email. That separate zap does send an email, but this one does not. 

 

That is understandable, my guess is that the “No data” part generates some error stopping the Zap from reaching the email part.

When I change the status of SubTask1_Test I get an email with this as text: 

(and a second email from that separate Zap)

 

Now, as seen the ID is wrong. It’s should be #865bqxt12. This is the problem I want solved.

 

Just noticed I also got this email, as expected.

 

NOTE: THIS IS NOT AN ISSUE, THIS IS NOT THE ISSUE I WANT SOLVED

Sorry for the caps. 

 

 

Oh my god.

I tried to check what I get if I change the email body to include the parent  object as a whole, not simply its ID:

 

 

Expecting to get something like this:

 

What did I get?

 

 

That was quite unexpected. For one, this confirms that Parent does actually contain MainTask_Test when MainTask_Test is the current task. It makes it even weirder that the ID provided is wLt4TvVoqgHLbCFtj0FCF6wdCi97eqZA and not 865bqxt12.

And then its also unexpected that the parent object itself doesn't return a full text representation of the object, but rather just its ID… this time, correctly  

 

I went through all text relevant for MainTask_Test here:

 

 wLt4TvVoqgHLbCFtj0FCF6wdCi97eqZA  isn’t there anywhere.

 

 

 

So if “Task Parent” only is the ID of the parent and not the parent object, how do I get access the custom fields of the Parent?