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 trying to create an issue using Rest API and affects version/s field is mandatory in our create issue screen.
"versions":[
{
"id":"15911"
}
],
Tried using the above mentioned syntax but I get this
error {"errorMessages":[],"errors":{"versions":"Version id '15911' is not valid"}}
The id I used is from projectversion table,is that the right id? Also tried with name instead of id and got similar error.
{"errorMessages":[],"errors":{"versions":"Version name 'Example 1.3.1.4' is not valid"}}
How can Affect Version/s value be set?
Can you please run the REST API call GET /rest/api/2/project/{projectIdOrKey}/versions for the project you are trying to create the issue in and verify if the version ID is present for this project.
Hello @Mohamed Riza,
Thanks for your response!
Ran the mentioned link to fetch the list of versions pertaining to the project I was working on and tried the same code - it worked! Earlier I was trying with a version of a different project. :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Mohamed Riza @Sravya Vuggina
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.
@aliva dash Below JSON would work for the fix version and affected version as well. Hope this helps
{
"projects": [
{
"name": "VIEW",
"key": "VEW",
"versions": [
{
"name": "Active Projects"
}
],
"issues": [
{
"priority": "High",
"status": "OPEN",
"resolution": null,
"issueType": "Defect",
"summary": "[Documentation] = Extra arrow in help",
"assignee": "dbagul",
"affectedVersions:" : ["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": []
}
]
}
]
}
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.