Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Can't create issue from API

wikabi9119
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 10, 2022

I've started a brand new jira instance, it is clean.

I created a new sample project (with fake data) and added a new text field "myt". I associated it with all projects, and with all screens.

I can create an issue from the UI, and that new field appears.

However when I try to do the same from the API, it fails with

{"errorMessages":[],"errors":{"myt":"Field 'myt' cannot be set. It is not on the appropriate screen, or unknown."}}

Creating a issue from the API without that field works fine.

 

I've read this problem could be related to a screen association issue, but I already added my field to all screens, so I don't think it's that.

What else could be the issue ?

 

Thanks

2 answers

0 votes
Fabio Racobaldo _Catworkx_
Community Champion
November 10, 2022

Hi @wikabi9119 ,

custom fields in REST api need to be referenced through id and not using the name. "myt" should be something like "customfield_XXXXXX".

Hope this helps,

Fabio

0 votes
Carlos Garcia Navarro
Community Champion
November 10, 2022

Hi @wikabi9119 ,

I know that you checked that the field appears in the screens, but just in case, did you verify that it's in all types of screens (more specifically the 'create' one? Also, check this out:  https://community.atlassian.com/t5/Adaptavist-questions/Field-customfield-10011-cannot-be-set-It-is-not-on-the/qaq-p/1672153

When you create the issue manually, can you set the field 'myt'? Is it possible that there is more than one field called 'myt'?

wikabi9119
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 10, 2022

I figured it out, it needs to be set by its custom field id, not name

Like Carlos Garcia Navarro likes this

Suggest an answer

Log in or Sign up to answer