Jira REST API getting error, unable to create an issue using Postman

Murugan Mittapalli June 7, 2020

Hi,

 

I am trying to create an issue using Jira REST API on Postman but I am getting errors, Please find below error. All fields are available on the create and edit screen, I do have permission to create an issue.

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

"Alarm Type""Field 'Alarm Type' 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.",    
   
 
"Nagios Host Name""Field 'Nagios Host Name' cannot be set. It is not on the appropriate screen, or unknown.",  
      
"Reported Date""Field 'Reported Date' cannot be set. It is not on the appropriate screen, or unknown.",        

"Alarm State""Field 'Alarm State' cannot be set. It is not on the appropriate screen, or unknown.",    
   
 
"SEV Level""Field 'SEV Level' cannot be set. It is not on the appropriate screen, or unknown.",      
 
 
"Host Name""Field 'Host Name' cannot be set. It is not on the appropriate screen, or unknown.",       

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

 
"Service Type""Field 'Service Type' cannot be set. It is not on the appropriate screen, or unknown.", 
    
   
"Notes""Field 'Notes' cannot be set. It is not on the appropriate screen, or unknown."    }}

REST API ERROR.PNG

Thank you.

2 answers

1 accepted

2 votes
Answer accepted
Hana Kučerová
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 8, 2020

Hi @Murugan Mittapalli ,

I think the main problem is you are using fields' names instead of identifiers.

Please, look at the example in the create issue section: https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issue-createIssue

Request body should look like this (you need to modify it based on the types and ids of your fields):

{
"fields": {
"project": {
"id": "10000"
},
"summary": "My summary",
"issuetype": {
"id": "10000"
},
"assignee": {
"name": "myuser"
},
"customfield_30000": [
"10000",
"10002"
],
"customfield_80000": {
"value": "red"
},
"customfield_20000": "06/Jul/11 3:25 PM",
"customfield_40000": "this is a text field",
"customfield_70000": [
"jira-administrators",
"jira-software-users"
],
"customfield_60000": "jira-software-users",
"customfield_50000": "this is a text area. big text.",
"customfield_10000": "09/Jun/81"
}
}
Murugan Mittapalli June 8, 2020

Thank you so much @Hana Kučerová , it worked and I really appreciate that.

0 votes
Sachin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 7, 2020

Hello Murugan,

The below error clearly suggests that "Custom Field is not on the appropriate screen", so the easiest way to know which fields are required and are available on your "Create Screen" is to manually create a ticket via GUI and then make changes to your JSON accordingly or just try adding all the custom fields to your create screen before making a rest call. 

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

You can also look at below two articles and see if it helps. 
Project screens, schemes and fields
Field 'customfield_10012' cannot be set

Best,
Sachin.

Murugan Mittapalli June 8, 2020

Thanks for your response Sachin,

All the fields are available on the create and edit screen, I have created some test tickets as well using those fields, Please find some screenshots.

 

Thank you.Assignee field.PNGTicket.PNG

Murugan Mittapalli June 8, 2020

Thank you so much @Hana Kučerová , it worked and i really appreciate that.

Suggest an answer

Log in or Sign up to answer