i have created a workflow and a transition in that where if a user wants to transition the status of issue from to do to in progress a custom field analysis should be filled and i am trying to transition the issue via rest api i am getting the custom field which is required but when i am trying to update the field i am getting an error
Error transitioning issue: Error: Failed to transition issue: 400 Bad Request. {"errorMessages":[],"errors":{"customfield_10038":"Operation value must be an Atlassian Document (see the Atlassian Document Format)"}} this is the resolver function
resolver.define("transitionIssue", async (req) => {
const { issueId, transitionId, fields } = req.payload;
console.log(fields, "custom")
try {
// Make a POST request to transition the issue
const response = await api
.asApp()
.requestJira(route`/rest/api/3/issue/${issueId}/transitions`, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
transition: {
id: transitionId,
},
fields : fields
}),
});
// Check if the request was successful
if (!response.ok) {
const errorResponse = await response.json();
throw new Error(
`Failed to transition issue: ${response.status} ${response.statusText}. ${JSON.stringify(errorResponse)}`
);
}
// Return a success message
return { success: true, message: "Issue status updated successfully!" };
} catch (error) {
console.error("Error transitioning issue:", error);
throw new Error(`Failed to transition issue: ${error.message}`);
}
}); this is the custom field value i am getting from frontend