Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Trello REST API - Checkitem update member

Sunny Ape
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 10, 2021

Does anyone know the correct method of updating the member for a checkitem on a card? The Trello REST API docucmentation doesn't yet describe how to do this.

I've tried doing a PUT request to the correct endpoint for the checklist, like this:

https://api.trello.com/1/cards/{id}/checkItem/{idCheckItem}?due={yyyy-mm-ddThh:mm:ss.000Z}&idMember={idMember}&key={key}&token={token}

The due date is correctly set, but the member never gets set and the REST API reports no errors.

If I do a GET request to see what the current field values are for that checkitem, the JSON response is:

{
  "idChecklist": "5fb5af30a002b753bdfa5755",
  "state": "incomplete",
  "id": "5fb5af96581f6180fb36d8a2",
  "name": "The checkitem name",
  "nameData": null,
  "pos": 101034,
  "due": "2021-02-12T07:00:00.000Z",
  "idMember": null
}

If then I manually set the member using the web interface, then send that GET request again for the same checkitem, I can see the member is now set:

{
  "idChecklist": "5fb5af30a002b753bdfa5755",
  "state": "incomplete",
  "id": "5fb5af96581f6180fb36d8a2",
  "name": "The checkitem name",
  "nameData": null,
  "pos": 101034,
  "due": "2021-02-12T07:00:00.000Z",
  "idMember": 5f67d7cdb2916e4b3f4fcc7e
}

3 answers

1 accepted

0 votes
Answer accepted
Sunny Ape
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 12, 2021

Problem resolved to faulty code. Two REST API endpoints exist for updating member for checkitem

0 votes
milynnus
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 22, 2021

@Sunny Ape 

Bottomline. No business class, the fields are not updated. Am I right?

Sunny Ape
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 22, 2021

Yes. You are right.

0 votes
milynnus
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 10, 2021

@Sunny Ape 

The api appears to be different from the documentation

PUT /1/cards/{idCard}/checklist/{idChecklist}/checkItem/{idCheckItem}

because due and member is specific to Advanced Checklist no info is provided there. I recall be able to do both by unpacking a python wrapper update both. 

Sunny Ape
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 10, 2021

Are you saying members cannot be added to checkitems via the endpoint I've used and must be added via the endpoint you've shown above? I tried that too and also got the same result.

Can you please provide an example of the Put method (ie the URL and Body of the request) you used to add a member to a checkitem.

Thanks,

milynnus
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 10, 2021

@Sunny Ape 

 

The api was taken from Trello documentation page which I observed to be different. I will need to dig up my notes. 

milynnus
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 10, 2021

@Sunny Ape 

EDDDD094-98A5-4AD0-B6DF-1754126FF32E.jpeg

I recall unpacking from this python function for member. 

milynnus
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 10, 2021

@Sunny Ape 

Not so good news. I coded a test program. It seems that it does not work for idMember as well a due. Could it be that I am no longer on Business Class trial?

Sunny Ape
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 10, 2021

OK, I've found how to do it. It's done by doing a Put request to either the endpoint for the checkItem in the card OR the checkitem in the checklist in the card.

This is one method:

PUT /1/cards/{id}/checkItem/{idCheckItem}?due={yyyy-mm-ddThh:mm:ss.000Z}&idMember={idMember}&key={key}&token={token}


This is the other:

PUT /1/cards/{id}/checkList/{idCheckList}/checkItem/{idCheckItem}?due={yyyy-mm-ddThh:mm:ss.000Z}&idMember={idMember}&key={key}&token={token}

If you prefer, you can define the due, idMember, key and token values in a JSON formatted body of the request instead of within the URL.

When I used these methods with Postman, they worked fine. When I used my code (PowerShell), it didn't work.

It turned out to be an obscure aberration in the PS code itself that, once I fixed it, the request worked fine.

milynnus
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 12, 2021

@Sunny Ape 

Congrats.

That final API is exactly the same as the one I tested. Out of curiosity, are you on Business Class?

Sunny Ape
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 12, 2021

I, personally, am not on Business Class. But, I also have access to Trello via an Enterprise level license via some others that I'm working for, so I used their Trello instance to double check everything is working correctly and also see the results via the web interface.

It's a bit misleading that the REST API will not give you any errors if you set the due date and member for a checkitem if you don't have Business Class or higher, so you are fooled into thinking everything has worked. However, when you check the value of the due date and member after setting them, they are still 'null'.

milynnus
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 22, 2021

@Sunny Ape 

I am back on this again. I do not have business class. So are you saying that if API runs clean, the update is actual successful except that when you try to retrieve it back it will show None? or null?

Sunny Ape
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 22, 2021

Sort of; it depends on what you mean by 'cleanly'.

  • If by 'cleanly' you mean "no errors", then yes, it's clean
  • If by cleanly you mean "the value is set and no errors", then no, it's not clean

If you don't have Business Class, you can use the REST API to TRY to set or update the value, and get no error, but in reality, the value doesn't get set to anything, it stays as null / none.

It would be better if the REST API gave an error and at least told you that your license level doesn't allow setting that value, or something similar.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events