XRAY: Resolving "Failed to Persist Vulnerability" in Xray Create Issue Event API

XRAY: Resolving "Failed to Persist Vulnerability" in Xray Create Issue Event API

AuthorFullName__c
Jian Sun
articleNumber
000006277
FirstPublishedDate
2024-12-17T13:15:02Z
lastModifiedDate
2025-08-01
VersionNumber
2
Introduction 

When trying to persist a custom issue by the JFrog Xray API, the server responds with a 500 Internal Server Error.

User-added image 


Root Cause 

The id field for a custom vulnerability issue in JFrog Xray has a strict character length limit of 32 characters. If the provided id exceeds this limit, it will cause a database insertion failure.
And you can see the error message in the xray-server-service.log:

User-added image 


Resolution 

Ensure that the id field in your API payload does not exceed 32 characters. For example:
Original Payload:
"id": "CustomIssue_rhOUogrEA0IEz8NPxxxxxxxx"
Corrected Payload:
"id": "CustomIssue_rhOUogrEA0IEz8NP"  // Total <= 32 characters