You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
I have looked at countless JIRA API docs and I still have no luck with it all. I get a 401 error trying to make an API call between my rocketchat server and jira server.
The credentials are 100% correct and I have set all the permission to "Anyone on the web" which means it is nothing to do with incorrect credentials right?
import {
IHttp,
IModify,
IRead,
} from '@rocket.chat/apps-engine/definition/accessors';
import fetch from 'node-fetch';
import {
ISlashCommand,
SlashCommandContext,
} from '@rocket.chat/apps-engine/definition/slashcommands';
export class n implements ISlashCommand {
public command = 'bb';
public i18nParamsExample = '';
public i18nDescription = '';
public providesPreview = false;
public async executor(context: SlashCommandContext, read: IRead, modify: IModify, http: IHttp): Promise<void> {
const supply = {"fields": {"project": {"key": "HUS"}, "summary" : "LOL", "issuetype": {"name": "Task"}}}
const response = await fetch('http://localhost:8080/rest/api/2/issue/', {
method: 'post',
body: JSON.stringify(supply),
headers: {'Content-Type': 'application/json',
'Authorization': `Basic ${Buffer.from('email:api_token').toString('base64')}`},
});
const responseText = await response.text();
};
};
The auth section was taken from https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-types/#api-rest-api-3-issuetype-post
Please can someone shed some light on this, much apprechiated