steves/node-jira

createRemoteLink handles 201 as error

truefalse10 opened this issue · 1 comments

When you create a new remoteLink the server always returns a 201 which indicates that the resource was successfully created. The function createRemoteLink though will always return an error if there is no 200.

this.doRequest(options, function(error, response) {
            if (response.statusCode !== 200) {
                callback(response.statusCode + ': Unable to connect to JIRA during request.');
                return;
            }

This repo isn't as actively maintained anymore. Which is why my colleague and I forked it and pushed our own jira-client. I'm pretty sure that our version does not throw for 201 status codes: https://github.com/jira-node/node-jira-client/blob/2b9f4f4445ff6eea0a20637fc67456595ea6ef2d/src/jira.js#L174-L188. Ours is written with the newer async/await support from Babel, which means the result is a Promise.