Card Completed time stamp

Hi there,

Can someone shed some light on getting the timestamp that a card was marked ‘completed’?

  • Looking at the .json of the “card back” shows a ‘dateCompleted’ attribute, which isn’t pulled through the API and isn’t shown in ‘actions’.
  • Scrolling actions on the card back (in the web app or using .json), will not include the ‘updateCard:dueComplete’ action if the card has been transferred to a different board.
  • The above is also true through the API.

For us, completed cards are moved from the board into a ‘completed’ board. From my testing, it seems that the act of moving the card wipes the ‘updateCard:dueComplete’ action from the card - so we cannot see who completed the card & when. The .json of the card (web app) shows ‘dateCompleted’, but doesn’t say who, and since this isn’t pulled through the API, there’s no way of knowing when & who completed a card besides by ‘guessing’ from the other actions (all(?) of which seem to be preserved, all the way back to card creation).

(There may be other situations that are clearing the action - this is the only one I’ve found from testing)

Why is this? Feels like unintended behaviour. Similarly, how can I know when & who completed a card, assuming it will be moved out of an active work board once it’s marked complete?

Cheers,
Tyler

Hello @TylerJensen

I have replicated that behaviour you have described.

If I have an incomplete card on a board, and I use the Get Actions on a Card endpoint against that card, and filter all the actions to only those of the type updateCard:dueComplete, there is a 200 response with an empty array, as expected.

If I use the GUI to mark the card as complete on the board, then do the same request, the response is 200 again and contains all the information about who completed the card and when etc etc, as expected. This matches what I see in the card’s history details via the GUI.

If I then move that card to another board and look at it in the GUI, the green ‘completed’ tick in the top left corner of the card still shows it is complete, and the card history still shows it had previously been completed, at the known time, before it was moved, but the same API request to the same card now returns a 200 response and an empty array for updateCard:dueComplete actions, as if the card is incomplete, as you’ve described.

If I then un-complete the card, then re-complete the card, the same API request now correctly returns a 200 and all the information about who completed the card and when etc etc, but of course that is not the ‘original’ time it was completed, it is the ‘new’ time it was completed.

Essentially, moving a completed card to another board does indeed make the last updateCard:dueComplete action somehow ‘invisible’ to the REST API.

I don’t think this is intended behaviour either. The bug doesn’t affect me personally, so you’ll need to log it yourself.

1 Like

I have done some testing and found what is happening. When a card is moved from one board to another, many past actions, not just the updateCard:dueComplete action, are actually being ‘erased’ from or becoming ‘invisible’ in the actions history that is available to the REST API.

I created a card on one board, changed lots of things like adding comments, changing the description, changing custom fields, marking it as complete etc etc, then calling the Get Actions on a Card endpoint with filter=all, and the entire set of all actions were returned in the response, with all their information, exactly as expected.

I moved the card to another board then ran the same request to return all the actions on the card. In the response, the moveCardToBoard action is the first entry, with all its details, but all the past updateCustomFieldItem and updateCard actions are simply not there any more. Some actions such as commentCard and createCard are still there, but the rest of the prior actions are definitely no longer included in the response, despite them all still showing the card’s history details in the GUI.

It seems that when a card moves to a new board, some of the past actions have their associated board:id value updated to the new board’s ID, but the others are not. This might be making them ‘invisible’ to the API endpoint, as it might be using a sub-filter to exclude actions that happened when the card was a member of another board other than the one it’s currently a member of. That’s the only logical explanation I can think of.

1 Like

Hey @sunnyape,

Appreciate you having a look at this. I hadn’t seen any docs that describe which actions are transferred, or when actions might be wiped from a card. Would be nice to know what might cause this & what data that’s affected. I’d noticed the ‘actions’ list seemed shorter on some cards but never looked closely to see when & why :man_shrugging:

I wonder if the actions being wiped are still listed on the previous board? Not sure why some would be transferred and others not though - seems strange. I’ll test some more & see if I can find out. For now, I’ve just implemented adding a ‘comment’ with the data that’s cleared, and read that comment after the transfer. Doesn’t look like I can report the bug either as the account it’s on is a ‘free’ one - if I get bothered enough I’ll replicate on a paid one and see if that triggers more of an explanation response/ fix from Trello.

Cheers,
Tyler

@TylerJensen . I just found the answer… this is expected behaviour.

From the Trello | Move cards or lists documentation:

Note: When a card is moved to another board, we’ll copy the card descriptions, checklists, attachments, and comments. We won’t copy card history/activity, and members of cards that aren’t members of the target board will be removed from those cards when it’s moved.

Oh well, at least we know now what is going on.

The statement “We won’t copy card history/activity” is a bit misleading, as the card history visible via the GUI still shows The Ghosts of Actions Past, but they no longer exist in the material world :wink:

So, your idea of creating a comment containing the relevant information about the card being marked as complete seems like the only reliable way to persist that information when moving the card to another board.

2 Likes

You legend - well that explains it then.

That little note should definintely be in the API docs. Interesting to note, inferring from this that cards aren’t actually ‘moved’ between boards (ie: board-id update) but rather a new card is created, with a bunch of data copied accross (inlcuding the original object ids) and some history - (although of a different history type) - and the original card is deleted along with all it’s data. Whether the new card is the original card becomes somewhat of a ‘card of Theseus’ paradox I suppose.

Very good to know. Surprised I couldn’t find much previous disussion on this, seems like something others would have encountered. This means any other automations, plugins or user interaction moving a card manually will break my preservation of that data - something I’ll need to be careful about.

Cheers mate :ok_hand:

1 Like

I don’t think so. The card is ‘moved’ by sending a PUT request to the Update a Card endpoint, and setting a different boardId and listId for the card (and also the pos parameter for the card’s position in the destination list). During the ‘move’, the things that we now know that are omitted are omitted, but it’s still the original card with the original ID.

Since every single card in Trello has an absolutely unique ID, you know it’s not a database record copy-and-delete operation, but just a database record change operation, which is must faster.

That cracked me up!!