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 get an error which states that the fields 'summary' and 'description' cannot be set because it is either unknown or not in appropriate screen.
I have seen many topics relating to this issue and I most likely suspect it to be an issue with authorization because I have added both fields to my screen.
My code is:
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 = 'n';
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": "TEST the API","Description": "testing API","issuetype": {"name": "Bug"}}}
const text = "username:password"
const encoded = Buffer.from(text, 'utf8').toString('base64');
const response = await fetch('http://localhost:8080/rest/api/2/issue/', {
method: 'post',
body: JSON.stringify(supply),
headers: {'Content-Type': 'application/json',
'Authorization': 'Basic ' + encoded},
});
const responseText = await response.text();
};
};
Is this how you authorise a request with API or not?
Welcome to the Atlassian Community!
This is what you think it is. If your fields are on an issue-type's edit screen, then you can get a "not on screen / unknown" message when you have not authenticated correctly because you won't be able to see the screen you're trying to use.
My fields are within the screen I want. I've checked in the settings and they are both available within the screen.
My assumption is that it isn't authenticating the API call, does the API call look correct to you?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Your coding language is not familiar to me, I'm sorry.
I suspect what you do - the authentication, not the application settings.
The authentication part does look ok, but only for systems still enabled for basic authentication (username/password), and I'm not sure that your system still supports that, Atlassian are gradually getting rid of it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I see, I'll try another authentication method and see if that fixes the issue or not - Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Nic Brough -Adaptavist- ive tried to use the API token method for authorisation (email:api_token) but i am still getting this error,
{"errorMessages":[],"errors":{"Summary":"Field 'Summary' cannot be set. It is not on the appropriate screen, or unknown.","Description":"Field 'Description' cannot be set. It is not on the appropriate screen, or unknown."}}
For Auth I used this as guide https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-types/#api-rest-api-3-issuetype-post
Any thoughts on how to tackle this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm afraid it's the same answer - either your authentication is wrong or your create issue screen doesn't have the right fields on it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.