"Field 'customfield_10012' cannot be set. It is not on the appropriate screen, or unknown."

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?

 

 

 

 

6 answers

1 vote
Thomas Schlegel Community Champion Nov 01, 2017

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.

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.

0 vote

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);

 

@Thomas - thanks for quick response - certainly points me in the direction to investigate. :)

Thomas Schlegel Community Champion Nov 01, 2017

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.

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?

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.

Thomas Schlegel Community Champion Nov 01, 2017

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.

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.

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)

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?

Thomas Schlegel Community Champion Nov 02, 2017

no, JQL is for issues only

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Posted 9 hours ago in Jira

We want to know what Jira Service Desk apps you're using!

Hi Community! My name is Amir and I’m on the Jira Service Desk product marketing team at Atlassian. Our team would love to understand how you’re leveraging our ecosystem for Jira Service Desk. Wha...

33 views 0 5
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you