Subtask Ordering API

I’m trying to add subtasks upon the addition of a tag using the API. I’ve managed that fine but I’d like to add the subtasks at the bottom of the list of current subtasks.

From reading other forum posts I see there’s now a way to do something like this, using insert_after/before properties. How would I use these exactly in my case?

Also, side question: If I’m adding multiple subtasks and want to preserve their order, I assume I have to make separate calls and can’t use a batch. Is that right?

Thanks

PS. I thought it would be {“insert_before”: “null”} but that doesn’t seem to work.

Hi @Peter_Bradshaw,

As I recall, you do want to leave insert_before as null, but you’ll also have to supply insert_after as the gid of the current bottom subtask in the list; that is, the subtask above which you want the new one to go.

Right!

2 Likes

For whatever reason, this doesn’t seem to be working. Request content is:

{
“data”: {
“completed”:false,
“name”:“In date HMO license”,
“insert_before”:“null”,
“insert_after”:“1200889633148723”
}
}

However, the subtask still appears above the subtask with ID 1200889633148723.
Am I doing something wrong here?

Are you trying to do that in your task creation call? You have to create the subtask first and then do a setParent call to set the order. Sorry for not being clearer on that.

3 Likes

Ah yes thank you. Sorry, didn’t realise I couldn’t do it all in one go. Thanks for the clarification. Working perfectly now.

1 Like

This topic was automatically closed after 6 days. New replies are no longer allowed.