I'm trying to update a HP QC Defect via REST API using PUT VERB. However, it will tell me it can't update the defect because of a "Missing required field".
I would understand if the field was actually required, but the thing it that it is not. I can go into QC, update that same defect with the value I am trying to update it with in script, and it works just fine.
If the Status field is set to deferred then "User-03" which is labelled "Deferred Reason" is a mandatory field and you can't save the defect without a deferred reason when status is deferred.
In this case, status is set to "Closed", so this required field does not apply in this work flow state. However, HP REST API 11 will still make me provide a value for every single "potential" required field regardless of the current workflow state.
This is a very bad design. Is there a way around this? I don't want to put dummy data in these fields just to satisfy an issue with HP's API.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<QCRestException><Id>qccore.required-field-missing</Id>
<Title>Missing required field: user-03 for entity defect</Title>
<ExceptionProperties/></QCRestException>
HP's rest api is bypassing the workflow/vbs configured for all these purpose. It is highly depended upon the customization metadata which we have per project.
To overcome what you should do is, go to customization -> Project entities -> entity -> custom fileds -> user-03. Mark it non required field from customization. In the workflow script still you can set it mandatory for specific conditions so that it works with same behavior from the user's point of view and hopefully rest will also allow you to update without specifying this field.
Thanks,
Gaurav