in nodes/YouTrack/resources/issueDraft/create.ts [34:55]
async function (this, requestOptions) {
const project = this.getNodeParameter('project') as string;
if (!project) {
return requestOptions;
}
// Validate that it's a database ID format (number-number)
const isDatabaseId = /^\d+-\d+$/.test(project);
if (!isDatabaseId) {
throw new NodeOperationError(
this.getNode(),
`Invalid project ID format: "${project}". Please provide a database ID in the format "0-0" (e.g., "0-0", "1-2"). Use the "Get Projects" operation to find the database ID if you only have the short name.`,
{ itemIndex: this.getItemIndex() }
);
}
if (requestOptions.body && typeof requestOptions.body === 'object') {
(requestOptions.body as IssueDraftCreateRequestBody).project = { id: project };
}
return requestOptions;
},