Using Relationships with the API
Log In
Marcelo Cecin
Thanks Jake Spirek
I managed to use relationships through the Pipedream call:
const resp = await axios($, {
method: 'POST',
url: `https://api.clickup.com/api/v2/task/${taskId}/field/${fieldId}`,
headers: { "Authorization": `Bearer ${token}`, },
data: { value: {add: [relationId], rem: [] } } });
references:
I can't understand why they don't include this and other functions in the official documentation.
Jake Spirek
Marcelo Cecin They do but it's a little hidden https://clickup.com/api/clickupreference/operation/SetCustomFieldValue/
Caroline Ginty
Caroline Ginty
Merged in a post:
Add custom relationship
Daniel Høiberg Lambrecht
The possibility of creating a relationship is now possible through the API, But I still need to be able to add a task in a custom relationship via the API.
Without it, the relationships that are made through the API is not structured in any way.
Jake Spirek
For anyone looking how to do this, it's possible! Carson mentioned steps below, and I've also made a video tutorial for doing this with the API using Integromat: https://www.youtube.com/watch?v=-VzaMLbUnqc
Link to the API docs under Custom Fields. (Look for Field Values and also Tasks) https://jsapi.apiary.io/apis/clickup20/reference/0/custom-fields.html
Matthew Freebersyser
Jake Spirek: well done, thank you!
J
James Doan
Jake Spirek: Awesome Jake works a treat
Lisa Nguyen
Jake Spirek: Wow you have a new fan. I love this. Thank you so much!
Jake Spirek
Lisa Nguyen: glad it helped!
Jake Spirek
Lisa Nguyen: thanks for the super kind words you posted on the YouTube video. I saw the email notification but I think YouTube deleted the comments because of the Canny link you included. Anyway just wanted to let you know I wasn’t deleting them haha and I was very appreciative of the kind words!!
O
Oleg Dubyk
+
Carson
So, I haven't looked into creating a brand new relationship type via the API, but after a little bit of trial and error, it's actually currently possible to add new items to an existing relationship (for example, to link to a task in a list of building locations to an existing building-manager task).
This is accomplished by obtaining the uuid of the custom field from the task or list in question, via the GET task API. Then, use the UPDATE custom field API endpoint to add to the relationship. You might need to use a developer tab in a browser to determine the payload you need, but for me, a payload of the following type worked:
```json
{
"value": {
"add": [ #list of task IDs to be added to the relationship
"9vz",
"7qj",
"2tq"
],
"rem": [] #list of task IDs to be removed from the relationship
}
}
```
at the following endpoint:
Jake Spirek
We're trying to migrate stuff from Notion and the fact that we can't set up automations with Relationships is a HUGE problem. We really want to have everything live in ClickUp, but we need robust Relationship support and the API and automations are KEY to that or it won't be able to live in Clickup.
Jake Spirek
As an update, it is possible, and I made a video to show how: https://www.youtube.com/watch?v=-VzaMLbUnqc
Sergio Illana Rico
Would it be possible to know when this will be implemented? At least an estimated date?
R
Rodd Myers
Including webhook when an item in the relationship is added or deleted
S
Severin Deutschmann
Rodd Myers: these two things would be awesome
Romet Kallas
This would save a ton of time for us as well. We're using relationships and rollups between Epics & User stories and it would be very powerful to programmatically create User stories, link already to the epic and leave it for the product manager to write up the tech specs.
Load More
→