Hi Team,
I recently ran into an issue while creating Jira issues via API when trying to set the Tempo Timesheets Account custom field.
When I tried passing it like a regular single-select field:
"io.tempo.jira__account": { "value": "Billable" }
I got the following error:
{"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]"}
After researching, I found that the correct way to set this field is by passing the id directly, for example:
"io.tempo.jira__account": 1
or
"customfield_100xx": 1
This works, but it’s different from how other custom fields with single select options behave. For normal single-select fields, I can pass an object like this:
"customfield_100yy": { "value": "Billable" }
Here’s what the field schema looks like from the API:
{
"type": "option2",
"custom": "com.atlassian.plugins.atlassian-connect-plugin:io.tempo.jira__account",
"customId": 100xx,
"name": "Account",
"key": "io.tempo.jira__account",
"hasDefaultValue": false,
"operations": ["set"],
"allowedValues": [
{ "id": 1, "value": "Billable" },
{ "id": 2, "value": "Non-Billable" }
],
"fieldId": "customfield_100xx"
}
My question:
Does the option2
type in Tempo’s Account custom field schema always expects an id (integer) instead of a { "value": "..." } or {"id": ..}
object?
Or is this behavior specific to Tempo custom fields and not a general rule for Jira custom fields of type option2
?
I’d like to understand the rule here so we can handle these cases consistently in our integration.
Thanks in advance for clarifying!
Hi @Kumkum Geervani ,
Does the
option2
type in Tempo’s Account custom field schema always expects an id (integer)
I'm no expert, but I would say yes. As it's a custom field that's provided by the Tempo app, it also has a different type than native fields. Usually, you would have select list field types and "Account" has "Account" field type.
Meaning, it's probably built differently than the native features, but I would recommend reaching out directly to Tempo with this. You can find their contact information here. (I'd say the recommended way to reach out would be to submit a support request via their portal)
Cheers,
Tobi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.