async function()

in nodes/YouTrack/resources/issueDraft/update.ts [42:63]


							async function (this, requestOptions) {
								const project = this.getNodeParameter('updateFields.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 IssueDraftUpdateRequestBody).project = { id: project };
								}

								return requestOptions;
							},