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,558,929
Community Members
 
Community Events
184
Community Groups

Field is not on appropriate screen or unknown

Edited

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? 

1 answer

1 vote
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 28, 2023

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? 

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 30, 2023

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.

I see, I'll try another authentication method and see if that fixes the issue or not - Thanks

@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?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 02, 2023

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.

Suggest an answer

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

Atlassian Community Events