I am getting an error for "environment" field while submitting the request with following JSON. Environment is not a custom field and id in the api is also "environment'. Anybody can tell me what is wrong here:
{ "fields": { "project": { "key": "projectkey" }, "summary": "[entry.summary.escapeJSON]", "description": "[entry.description.escapeJSON]", "environment": "[entry.environment.escapeJSON]", "issuetype": { "name": "Incident" } } }
error message:
Hi Deepak,
As the Error is noting "It is not on the appropriate screen, or unknown" I would recomend verifying the the Field is on the create issue screen used by your workflow as the first point.
Take a look at http://<base_jira_url>/plugins/servlet/project-config/<projectkey>/screens to see what your create screen is for the project / issue type and then look at the screen verify the field is present.
Let me know if this is the issue.
Regards,
Earl
@Earl McCutcheon Thank you for reply.
Yes, the Environment field is present for the Incident(issue type) create issue screen.
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.
Hi Deepak,
Thanks for the confirmation, and since it's on the correct screen this means we gotta track down the "Unknown" portion of the error.
Generally when this error occurs and is not related to the screen it's going to be either a permission conflict or a syntax related error in the call.
First and this is a quick check, verify the project level permissions permissions allow the user you are submitting the request as to complete the action from the UI, exe edit the issue and update the field.
Then it could be an issue with the user/token formatting used to submit the call, check out this article and verify the settings on the authorization credential
Are you using a Application to pass the call like PostMan or are you doing a direct curl call to the endpoint, either way can you send me the full syntax of the call or a screenshot of the application settings you are using making sure to obfuscate the sensitive details like your base URL, auth token and username, while also doing a GET on the same endpoint to verify that results of the GET have a matching syntax to the POST and wether the GET is successful or not.
EXE POST to /rest/api/2/issue:
curl -D- -u EMAIL:API-TOKEN -H "Accept: application/json" -H "Content-Type: application/json" -d '{ "fields": { "project": { "key": "projectkey" }, "summary": "gf", "description": "trt", "environment": "yryr", "issuetype": { "name": "Incident" } } }' -X POST http://INSTANCE/rest/api/2/issue
Regards,
Earl
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.