Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,554,070
Community Members
 
Community Events
184
Community Groups

Unauthorised Access 401

Edited

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

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
9.7.0
TAGS
AUG Leaders

Atlassian Community Events