We had a customer asking if we could render the Message Custom Field (for edit) custom field type (com.atlassian.jira.toolkit:message
) in the create issue form of one of our apps (the form is rendered outside the Jira context using the REST API).
How does this field work?
This is a Jira built-in custom field type that is provided by the Jira Toolkit plugin (which seems to be built into/ships with Cloud). Essentially, the field allows an admin to configure a default text value for the field which is then rendered as a read-only field in the create or edit issue form.
After some investigation, it seems this is not possible because (I assume) the implementation of this custom field is buggy or rather intentionally hacky.
Create metadata from the REST API returns the following:
GET /rest/api/2/issue/createmeta?...
{
// ...
"customfield_10637": {
"required": false,
"schema": {
"type": "string",
"custom": "com.atlassian.jira.toolkit:message",
"customId": 10637
},
"name": "Message Custom Field (for edit)",
"key": "customfield_10637",
"hasDefaultValue": false,
"operations": [
"set"
]
},
// ...
}
Strangely the field has no default value which does not make sense because the default value stores the read-only text that we would like to render. I assume this is because the custom field implementation in the Jira Toolkit plugin returns null
for getDefaultValue
(no clue what this comment means ):
/*
* Returning null here for the default value because the new quick edit plugin only forces fields to be required
* on the create screen if they have *no* default value. On quick edit users will still be able to remove the
* field but that's kinda the whole point of quick-edit!
*/
@Override
public String getDefaultValue(final FieldConfig fieldConfig) {
return null;
}
Here is my question: Is there a chance Atlassian will fix this issue?
I do understand that it may not be possible to fix this because this custom field works around some limitations in the Jira API to provide the read-only functionality. If that’s the case, I guess there is no way we can render this field in a Jira external create issue form.