Bug in trying to archive a project via the API?

Hi @Joe_Trollo, @Ross_Grambo, and team,

This looks like a bug to me…

If I try to archive a project by setting the archived flag to true, and I also have this property included in my request:
"is_template": "false"

then even though it’s set to false, the request fails with this error:

If I just remove the
"is_template": "false"
then everything works perfectly.

Certainly this error should be returned if I had is_template set to true, but it should not error when I have is_template set to false, right?

1 Like

Hi Phil,

Yep, this is a half-bug of sorts. The issue here is that we validate all API inputs even if they match the values already in our database. In this case, we’re validating an attempt to set is_template: false even though the project is already a template. It would be a fairly complex fix to make our framework to ignore properties that aren’t changing, and in general we recommend setting only the fields that you wish to change. I’ll file this internally though so we keep track of it, thanks!

I guess I’m still confused. The project in question is not a template. I understand what you’re saying about always validating even if the value is not changing, but why is the validation on is_template = false failing when the project is not a template and the request is not trying to set it as one?

Ah, sorry, I made a typo. I meant to say that we attempt to validate is_template: false even if the project is not a template. Our validation prevents any write to the is_template field if the project is archived, but you’re right that an archived project can safely be made not-a-template regardless of its current state.