A number of custom fields have been created but an error is returned when trying to create a JIRA issue and setting a custom field.
request body:
{ "fields": {
"project": { "key": "UCO" },
"summary": "111 - with custom fields",
"description": "Create issue with team custom field",
"issuetype": { "name": "Bug" },
"customfield_10012" : "Top Gear12" ,
"customfield_10010" : "Top Gear10" }
}
Error response:
"Field 'customfield_10012' cannot be set. It is not on the appropriate screen, or unknown."
Searching on this error shows that the field has to be added to the screen - but which screen?
How do I find out what screen to add the custom field to?
I can get field for screens using REST
/rest/api/2/screens/{screenId}/availableFields
but what value of screenId corresponds to which screen?
putting in a value of 1, 2, or 3 returns information but what screen is it for?
Hi Mirek,
since you are creating an issue, I assume, you have to add the custom fields to your issue creation screen.
Have a look at your project settings and there on the screens:
( http://<your jira url>/plugins/servlet/project-config/<projectkey>/screens )
Then open the screen that is used for creating an issue. Look at the URL. There you can see the screenId.
In that form, you can also add your custom fields to the screen.
I was also having the same problem, after following @Thomas Schlegel's suggestion, I added the custom fields to the screen and it worked.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Thomas Schlegel, I've followed your steps above, but not able to see the customfield(I'm using a single line text field) that has been added to the issue create screen through rest call as below.
/rest/api/2/screens/18311/availableFields
But the same can be shown in screen fields, through browser. Any thoughts on this one.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Thomas Schlegel , I met the same issue when I call create issue api in my code, the error 'It is not on the appropriate screen, or unknown.' But when test api with the same parameters in postman, it is succeed, so I don't think is the field doesn't add to screen causes the error, do you know the reason?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you u save to me Thomas I was triying to solve this per hours , Thank you @Thomas Schlegel
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.
Thanks, I was having issues with my JIRA Automation not being able to set a Request Type for a Service Desk issue. The URL above didn't work but this method did:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes, I thought that was the case.
Our product creates a JIRA project via REST API and should not need user to login to JIRA to find out screen id.
We need to find out the screen id via REST but I'm not seeing any way to do that - one possiblity is to send request for fields for tabs on screen:
rest/api/2/screens/10003/tabs/10103/fields
by iterating over screenId and tabId until we find the expected fields on the create/view/edit screen/tab. (I assume both start at 10000?) but that does not seem ideal.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
iterating over screen ids to find screen with matching fields won't work if there is more than 1 project.
The default (DEF) project and any other projects will each have a create/view/edit issue screen so won't be able to tell which is the screen in question. (as already stated above)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've got this issue when tried to set same field values which filed already has.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need the field on the edit screen to be able to set it. Your REST command has sent it, but the field is not there to edit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
just a thought, could JQL be used to get list of screens? (... but according to documentation this is for searching JIRA issues only)
If so, can an example be posted?
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.
Almost got all parts to solve the puzzle :)
Using the url above, the create/edit/update screen is 10003
Is this guaranteed to be the same for all Jira instances?
I would like to get the screen id using the REST API instead of via browser and above url - is that possible?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It depends how you move your settings from one instance to another. If you move via database or jira backup/restore then it will be the same. If you do it manually or use plugins then you never can be sure that id's will be the same. They can be the same and They can be not the same.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No, the screen id is not the same for all Jira instances. It also depends on the project, you are adding an issue to. Different projects might use different create screens.
As far as I know, there's no way to get the id of the create screen for a project using rest. There's an open issue for that functionality:
https://jira.atlassian.com/browse/JRASERVER-40440
There you can find some discussions about this.
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.
You're welcome, @mirek paszkowski
If you later think, one or both of our answers were right, please accept it / them as solution.
Answers to solved questions can be found more easy by other users who might have the same problem in the future.
Thank you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
It must be on the create screen. But you can disable this verification by the following statement:
IssueInputParameters issueInputParameters = new IssueInputParametersImpl(); //Set to skip screen check issueInputParameters.setSkipScreenCheck(true);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is there a parameter which can be used inside JSON body to skip this check?
Thanks,
Bhupesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have tried the below in the API request but still the issue persists:
.queryString("overrideScreenSecurity", true)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for all the posts here all. Is it possible to do this screen check skip on API calls to create an issue? I.e. the POST /rest/api/2/issue ?
What I want to do is clone an issue by getting and then setting the values of all the fields ... and it is a real problem if the fields need to be manually added (even if by the API) to the screens, esp if the issues will be created on variable projects.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No, the api respects the UI settings.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.