Forums

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

when create issue by postman by api rest v3 , appeared error message

mohamed gamal September 20, 2021

when create issue by postman by api rest v3

{
"fields": {
"project": {
"key": "DEV"
},
"summary": "Test Automation Mobile",
"issuetype": {
"name": "Bug"
},
"description": {
"type": "doc",
"version": 1,
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Test Automation Mobile"
}
]
}
]
}
}
}
it appeared 
{
"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."
}
}
although i can create issue by web jira  with mandatory fields summary- issue type- project 

2 answers

1 accepted

0 votes
Answer accepted
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 21, 2021

Hi Mohamed,

I understand that you are trying to create an issue using the REST API in Jira, but that you are getting this error when doing so:

"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."

While this error can happen when fields do not appear on the screen, I think was is more likely happening here is that your REST API call is not authorized in the manner expected to make this work.  If the authorization fails, Jira will continue to try to complete the POST call here, but it will do so anonymously.  And since most projects do not leave open the create issue permission, you can get this kind of error message in the process.

How are you authenticating your call here?  For most users that utilize postman, I would expect them to use Basic Auth.  This page explains how you can first generate an API token, and then encode that token in a string with the format of

user@example.com:APItoken

in a base64 encoded string.  Once you have that encoded string, you can craft an authorization header that will pass that string in order to be able to use basic auth.  If you're doing this, it suggests that perhaps the method used to encode the string could be incorrect.  Try this and let me know if you run into any problems with this approach.

Andy

mohamed gamal September 23, 2021

Thanks for your reply , i got the solution that i get another account for jira with more permissions , now i can create issue

 

but can you help me how i can create issue with attachments videos , pictures in same time because we use jira to create bug reproduction which needs to have video  to check the flow steps of app 

Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 23, 2021

If you have a validator on the create transition that requires an attachment, then you won't be able to use the REST API to create issues in that project.  This is because the REST API does not currently have this ability like the web UI has.  There is a feature request for this over in

There is a REST endpoint for adding an attachment in Jira Cloud, see POST /rest/api/3/issue/{issueIdOrKey}/attachments.  However this endpoint requires that you specify the issue id or issuekey.  I understand this is not exactly the same as the web UI of Jira will will let you do this.  But I do not have a perfect solution for you here.  The best I can see would be to alter the workflow to at least allow issues to be created without an attachment into a specific issue status, and then instead use the validator for other transitions. This could then let you create the issues via REST first, and then add the attachment.

mohamed gamal September 23, 2021

thanks for your reply  >> how to get the issue key directly from response by java code  after create issue to use it in the second query of add attachment ?

Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 24, 2021

When you make the POST /rest/api/3/issue to create a new issue, when Jira is successful, it will respond with a json payload that includes both the issuekey and the issueid of the issue it just created.  For example:

{"id":"15735","key":"SSP-28","self":"https://example.atlassian.net/rest/api/3/issue/15735"}

I made this call using curl, but other REST clients might not be listening for this response.  Not sure if postman is setup to capture this response to the POST, but it would be essential to quickly finding the issuekey for the attachment call to follow.

mohamed gamal September 24, 2021

@Andy Heinzer ok i got the repose but my problem how to extract the key  of issue from response to use it directly when add attachment 

 

doy have any idea about this extract by java code?

Shrikant Katagi October 17, 2023

@mohamed gamal 

I am also getting same error when I try to create an issue with service account. Below is the error message:

{\"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.\",\"components\":\"Field 'components' cannot be set. It is not on the appropriate screen, or unknown.\",\"customfield_11417\":\"Field 'customfield_11417' cannot be set. It is not on the appropriate screen, or unknown.\"}

Can you please let me know what extra permission you got for the account to make it work? 

0 votes
Shrikant Katagi October 17, 2023

  

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events