Tempo error when trying to create issue via the Jira Cloud REST API

I’m trying to create an issue in Jira via the REST API. I’m getting an error back that seems to have to do with Tempo. I’m assuming it’s because Account is a required field, but I don’t get why it can’t handle what I’m sending through as the account value.

This is what I’m sending through as the BODY of the curl request:

{
  "fields": {
	"summary": "WhiteHat: test",
	"issuetype": {
	  "id": "10041"
	},
	"customfield_10032": {"value":14},
	
	
	"project": {
	  "id": "10037"
	},
	"description": {
          "type": "doc",
          "version": 1,
          "content": [
            {
              "type": "paragraph",
              "content": [
                {
                  "type": "text",
                  "text": "description"
                }
              ]
            }
          ]
        },
	"reporter": {
	  "name": "Jira Monkey"
	}
  }
}

customfield_10032 is the Tempo Account field, found by mousing over the Edit link in the field configuration. 14 is the specific account ID I want to send, found by mousing over the account name in the Tempo -> Accounts screen.

I get this error back:

{“errorMessages”:[],“errors”:{“io.tempo.jira__account”:“Can not deserialize instance of java.lang.Long out of START_OBJECT token\n at [Source: N/A; line: -1, column: -1]”}}

What am I doing wrong?

1 Like

I found the solution to this issue. I was sending in the field as an object, because the V3 API seems to require that most custom field types be sent as objects. In this case, the Account field was expecting a simple data type.

Changing this:

"customfield_10032": {"value":14},

to this:

"customfield_10032":14,

allowed the issue to be created.

3 Likes

Thanks for sharing the solution!

Thanks @estrom … We also tried this and it works.

I find it very odd/frustrating that the documentation (ie. app_key__field_key": [{“value”:“a”},{“value”:“b”}] for multiselects ) does not work … but [1,2] does.

Thank you