Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×I am facing an issue w.r.t Affects Version/s
{"errorMessages":[""Affects Version/s" field is required and the project "xxx" does not have any versions."],"errors":{}}
meta data is as below
"versions":{"required":true,"schema":{"type":"array","items":"version","system":"versions"},"name":"Affects Version/s","hasDefaultValue":false,"operations":["set","add","remove"],"allowedValues":[]}
I am trying to create a issue via Jira python api
I am confused if the field is not there and why it is throwing error??correct me if am wrong
Could anyone help me to solve this issue??
Hello @Sridhar Mohan
Welcome to the community.
If you try to create the same type of issue in the same project through the UI are you required to enter a value for the Affects Version/s field?
Generally the fields that are required for a given issue type in a given project are determined in the Field Configuration/Scheme for that project. If you are getting this error then likely that field has been set as Required in the Field Configuration for that issue type in that project. Alternately a field can be set to be required during a workflow transition (in a Company Managed project) using a Validator to check if the field has been filled in. In either case, if you try to create the same type of issue in that project through the UI it should also be requiring you to fill in the field.
If a field is required when you try the operation through the UI, then you will have to provide the same data if you are trying the accomplish the operation through the API.
@Trudy Claspill I got your point that required field is necessary,But here in my project the Affects Version/s has no selectable value and is permanently set to "None".
Also not sure why api throws error " the project "xxx" does not have any versions"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Go to the Releases page for the project and see if there are any entries there in any states (Unreleased, Released, Archived). The message is complaining that there are no version defined.
Does the UI allow you to save the issue when the field is set to None?
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.
Then an administrator of the project needs to go to the Releases page for that project and create a version, and then select that version as part of your issue creation.
Or your JIRA Administrator needs to change the project so that the Affects Version/s field is not required, at least when an issue is being created.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Sridhar Mohan @Trudy Claspill
Can you please guide me on how to set the affects version/s on Jira ticket using Rest api & JSON. I tried this "versions" : [{"name": "2022.0"}] but it doesn't work.FYI version 2022.0 is already added to the project. Below is the JSON I am using for Jira import.
{
"projects": [
{
"name": "VIEW",
"key": "VEW",
"issues": [
{
"priority": "High",
"status": "OPEN",
"resolution": null,
"issueType": "Defect",
"summary": "[Documentation] = Extra arrow in help",
"assignee": "dbagul",
"versions:" : [{"name": "2022.0"}],
"created": "2019-02-01T16:05:52.13Z",
"updated": "2022-03-02T00:34:16.903Z",
"reporter": "dbagul",
"components": [
"Documentation"
],
"description": "!img_desc_2992_0.png!\n\n",
"comments": []
}
]
}
]
}
Using above json I always get the below error during import. I have also tried
"versions:" : ["2022.0"] and
"Affects Version/s:": [ "Active Projects" ] but none of it works
2022-05-05 23:25:32,704 ERROR - Failed to create data bean java.lang.RuntimeException: org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field "versions" (Class com.atlassian.jira.plugins.importer.external.beans.ExternalIssue), not marked as ignorable at [Source: java.io.StringReader@6e0b1a2f; line: 13, column: 25] (through reference chain: com.atlassian.jira.plugins.importer.external.beans.ExternalProject["issues"]->com.atlassian.jira.plugins.importer.external.beans.ExternalIssue["versions"])
Looking forward to hearing from you, thanks!
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.