jira-node / node-jira-client

A Node.js wrapper for the Jira REST API
https://jira-node.github.io/
MIT License
449 stars 168 forks source link

Move Ticket to another workflow (e.g. Transition to "In Progress") #354

Open lumo2707 opened 1 year ago

lumo2707 commented 1 year ago

Hi I am struggling with the API.

First of all I search the right transition object:

jira.listTransitions(issueNumber) .then(transitions => { const transitionToApply = _.find(transitions.transitions, (t) => { console.log(t.name) if (t.name.toLowerCase() === statusMatch.toLowerCase()) return true }) // Not found if (!transitionToApply) { console.log('Please specify transition name') console.log('Possible transitions:') transitions.transitions.forEach((t) => { console.log({ id: ${t.id}, name: ${t.name} } transitions issue to '${t.to.name}' status.`) })

            core.setFailed(`Please specify right transition name.`);
        }
  ......

` But how I need to call the following function:

transitionIssue(issueId: string, issueTransition: JiraApi.TransitionObject): Promise<JiraApi.JsonResponse>;

asharpe commented 1 year ago

I'd really like to help, but first I need to read your code, and... well I'm not going to read it like that :)

It seems like you're doing all the right stuff, what's the problem you're having?