I have be using https://www.npmjs.com/package/jira-client to create a JIRA utility and to update issue status via API
I initially listed all the transitions using
jira .listTransitions(<issueId (redacted)>) .then((result) => { console.log(result); }) .catch((err) => { console.error(err); });
{expand: 'transitions',transitions: [{ id: '4', name: 'Start Progress', to: [Object], fields: {} },{ id: '5', name: 'Resolve Issue', to: [Object], fields: [Object] },{ id: '2', name: 'Close Issue', to: [Object], fields: [Object] }]}
jira .transitionIssue("redacted issue number",{id: '5', name: 'Resolve Issue', to: [Object], fields: [Object]}) .then((result) => { console.log(result); }) .catch((err) => { console.error(err); });
Error: {"errorMessages":["Can not deserialize instance of java.util.LinkedHashMap out of START_ARRAY token\n at [Source: org.apache.catalina.connector.CoyoteInputStream@2115007d; line: 1, column: 45] (through reference chain: com.atlassian.jira.rest.v2.issue.IssueUpdateBean[\"fields\"])"]}
Found the solution
jira .transitionIssue("<issue number>", { transition: { id: '3' } })
It looks like you're new here. Sign in or register to get started.