DependencyTrack / DependencyTrack/dependency-track
Parent assignment not functioning for existing projects
- Dominant language
- Java
- Stars
- 4.2k
- Forks
- 811
- Avg merge
- 8h 39m
- Merged PRs (30d)
- 237
Description
### Current Behavior
When uploading a BOM file to a new project via the API "/v1/bom" using the "parentUUID" parameter, the operation works as expected. The new project is created as a child project.
However, when using the "parentUUID" parameter to upload a file to an existing project, which has no parent assignment yet, the call successfully uploads the BOM file as expected but does not assign the project to the specified parent.
The call appears as if it has only been partially processed:
- BOM file upload works.
- Parent assignment does not work.
### Steps to Reproduce
**Curl example:**
curl -X 'POST' \
'https://editor.swagger.io/api/v1/bom' \\
-H 'accept: application/json' \\
-H 'Content-Type: multipart/form-data' \\
-F 'project=a77126df-bfdc-4a5d-9748-2443c63abd5f' \\
-F 'parentUUID=c88236df-bfcf-4a5d-9748-2443c63abd5f' \\
-F 'bom=@bom.json'
**Notes:**
- project 'a77126df-bfdc-4a5d-9748-2443c63abd5f' exists with no parent assignment
- parentUUID 'c88236df-bfcf-4a5d-9748-2443c63abd5f' exists
### Expected Behavior
- API call could assign the existing project as a child to the specified parent project, when providing the "parentUUID" parameter or providing the "parentName" and "parentVersion" parameters.
- API call should return an error
### Dependency-Track Version
4.8.2
### Dependency-Track Distribution
Container Image
### Database Server
PostgreSQL
### Database Server Version
11.20
### Browser
Google Chrome
### Checklist
- [X] I have read and understand the [contributing guidelines](https://github.com/DependencyTrack/dependency-track/blob/master/CONTRIBUTING.md#filing-issues)
- [X] I have checked the [existing issues](https://github.com/DependencyTrack/dependency-track/issues) for whether this defect was already reported
Contributor guide
Assessment
This issue has not been assessed yet.