I'm developing a integration with Jira using the REST API's and have found a number of discrepancies between the metadata returned by the Get Create Issue Metadata API (of the form rest/api/3/issue/createmeta?projectKeys={ProjectKey}&expand=projects.issuetypes.fields) and the corresponding Create Issue API (rest/api/3/issue)
The first anomaly is that the metadata for the Sprint (customfield_10020) advises that it is of type array
"customfield_10020": {
"required": false,
"schema": {
"type": "array",
"items": "json",
"custom": "com.pyxis.greenhopper.jira:gh-sprint",
"customId": 10020
},
"name": "Sprint",
"key": "customfield_10020",
"hasDefaultValue": false,
"operations": [
"set"
]
},however if an array is passed in the body of the Create Issue API it fails with the following error:
{
"errorMessages": [
"Number value expected as the Sprint id."
],
"errors": {
}
}passing a simply number for the sprint id works successfully.
Also, the Description field metadata reports that it is of type string regardless of whether the api version used is 2 or 3.
"description": {
"required": false,
"schema": {
"type": "string",
"system": "description"
},
"name": "Description",
"key": "description",
"hasDefaultValue": false,
"operations": [
"set"
]
},Version 2 of the Create Issue API () does accept a plain string value, however, version 3 of the API fails with the following error:
{
"errorMessages": [
],
"errors": {
"description": "Operation value must be an Atlassian Document (see the Atlassian Document Format)"
}
}As a side issue, the Get Issue Create Metadata API returns "timetracking" as one of the "fields" and yet it is actually a wrapper around to individual fields (Original Estimate and Remaining Estimate) which are not reported at all. My expectation was that calling the Get Create Issue Metadata API should provide all of the information necessary to correctly structure the Create Issue API and yet it appears to be both inaccurate and incomplete. Am I missing a piece of the puzzle?