Closed tylerhammer closed 4 years ago
Just to do some additional validate, if I remove the jira-client and use node-fetch, it works as I would expect.
fetch(
'https://<DOMAIN>.atlassian.net/rest/api/3/issue/<ISSUE>/watchers',
{
method: 'POST',
headers: {
Authorization: `Basic ${Buffer.from(
'<USER>:<API>'
).toString('base64')}`,
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: `"<ACCOUNTID>"`,
}
).then((response) => {
console.log(
`Response: ${response.status} - ${response.statusText}`
);
});
As I suspected, this was an issue on my end. I had misspelled "protocol" in my configuration and it was defaulting to http. Correcting my spelling mistake provided me with the response I expected.
I'm utilizing the addWatcher method, and I seem to get some weird behavior. When I use the method in my function, it doesn't add the user and seems to return as if I was doing a GET against the URL. I confirmed in a packet capture that I am doing a POST, but I'm not sure what it doesn't like. When I complete this request in POSTMAN I have no issues.
I have a feeling I'm just missing something super simple here but any help would be appreciated.