Hi there,
I’ve scoured the internet and this forum and I am at a loss so hoping someone here can help. I’ve tried creating a single select custom field - both manually in the UI and through the API. For example, in the API, I call:
POST https://oururl/rest/api/2/field/
with the following body
{
"name": "Client Site",
"description": "Some description",
"type": "com.atlassian.jira.plugin.system.customfieldtypes:select",
"searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:multiselectsearcher"
}
And I get back a success;
{
"id": "customfield_10123",
"key": "customfield_10123",
"name": "Client Site",
"custom": true,
"orderable": true,
"navigable": true,
"searchable": true,
"clauseNames": [
"cf[10123]",
"Client Site"
],
"schema": {
"type": "option",
"custom": "com.atlassian.jira.plugin.system.customfieldtypes:select",
"customId": 10123
}
}
However, now that I have this field (and I can see it in the UI), literally all other field-related calls fail.
For example, I’d like to add an option to it like so:
POST https://oururl/rest/api/2/field/fieldKey/option
with the following body
{
"value": "Test Option"
}
and I’ve tried all of the following (trying to follow both documentation and suggestions online):
https://oururl/rest/api/2/field/com.atlassian.plugins.atlassian-connect-plugin__customfield_10123/option
https://oururl/rest/api/2/field/customfield_10123/option
https://oururl/rest/api/2/field/10123/option
https://oururl/rest/api/2/field/com.atlassian.jira.plugin.system.customfieldtypes:select__customfield_10123/option
https://oururl/rest/api/2/field/com.atlassian.jira.plugin.system.customfieldtypes:select__10123/option
and a lot of other combinations. And for all of them, I get one of two errors. Either
{
"errorMessages": [],
"errors": {
"fieldKey": "Field key 'whateverKeyITried' is not valid"
}
}
or
{
"errorMessages": [
"The field with the given key does not exist or does not support options"
],
"errors": {}
}
And I just don’t understand… Can anyone help?