Content
View differences
Updated by Attila Dombi 5 months ago
### Steps to reproduce
* Have required project attributes configured that are also "For all projects"
* The don't have a default value
* Sending `POST /api/v3/projects` with
```text ```
{
"name": "A project created via the api"
}
```
* This will return errors
```text
{
"_type": "Error",
"errorIdentifier": "urn:openproject-org:api:v3:errors:MultipleErrors",
"message": "Multiple field constraints have been violated.",
"_embedded": {
"errors": [
{
"_type": "Error",
"errorIdentifier": "urn:openproject-org:api:v3:errors:PropertyConstraintViolation",
"message": "Admin only cf (required) can't be blank.",
"_embedded": {
"details": {
"attribute": "customField676"
}
}
},
{
"_type": "Error",
"errorIdentifier": "urn:openproject-org:api:v3:errors:PropertyConstraintViolation",
"message": "Required List cf (for all) can't be blank.",
"_embedded": {
"details": {
"attribute": "customField514"
}
}
},
{
"_type": "Error",
"errorIdentifier": "urn:openproject-org:api:v3:errors:PropertyConstraintViolation",
"message": "Required date cf (not for all) can't be blank.",
"_embedded": {
"details": {
"attribute": "customField677"
}
}
}
]
}
}
```
* Send another request with
```text
{
"customField525": 5,
"name": "A project created via the api"
}
```
Please notice that this is another, non required, non active for all, project custom field
### What is the buggy behavior?
* The project is just created when it shouldn't as it is missing values for those required fields.
* Additionally required custom fields without the `is_for_all` flag are also validated, and they shouldn't.
### What is the expected behavior?
1. The required, "for all projects" project attributes should be enforced on project creation
2. Do not validate required custom fields with `is_for_all` set to `false`.
* Have required project attributes configured that are also "For all projects"
* The don't have a default value
* Sending `POST /api/v3/projects` with
```text
{
"name": "A project created via the api"
}
```
* This will return errors
```text
{
"_type": "Error",
"errorIdentifier": "urn:openproject-org:api:v3:errors:MultipleErrors",
"message": "Multiple field constraints have been violated.",
"_embedded": {
"errors": [
{
"_type": "Error",
"errorIdentifier": "urn:openproject-org:api:v3:errors:PropertyConstraintViolation",
"message": "Admin only cf (required) can't be blank.",
"_embedded": {
"details": {
"attribute": "customField676"
}
}
},
{
"_type": "Error",
"errorIdentifier": "urn:openproject-org:api:v3:errors:PropertyConstraintViolation",
"message": "Required List cf (for all) can't be blank.",
"_embedded": {
"details": {
"attribute": "customField514"
}
}
},
{
"_type": "Error",
"errorIdentifier": "urn:openproject-org:api:v3:errors:PropertyConstraintViolation",
"message": "Required date cf (not for all) can't be blank.",
"_embedded": {
"details": {
"attribute": "customField677"
}
}
}
]
}
}
```
* Send another request with
```text
{
"customField525": 5,
"name": "A project created via the api"
}
```
Please notice that this is another, non required, non active for all, project custom field
### What is the buggy behavior?
* The project is just created when it shouldn't as it is missing values for those required fields.
* Additionally required custom fields without the `is_for_all` flag are also validated, and they shouldn't.
### What is the expected behavior?
1. The required, "for all projects" project attributes should be enforced on project creation
2. Do not validate required custom fields with `is_for_all` set to `false`.