Hi everyone,
I have a Jira forge app, which defines a custom field in its manifest:
...
jira:customField:
- key: attachments-metadata
name: AttachmentsMetadata
description: Attachment Metadata
type: object
schema:
properties:
attachmentNames:
type: array
items:
types: string
Whenever I retrieve an issue via the REST API, I can see that the value of this field is null and its id is customfield_10044
.
Then I try to set the value for this field from a trigger function like this:
await api.asApp().requestJira(route`/rest/api/3/issue/${issueId}`, {
method: "PUT",
headers: {
Accept: "application/json",
"Content-Type": "application/json",
},
body: JSON.stringify({ fields: { "customfield_10044": {"attachmentNames":["test.pdf"]} } }),
});
However, this fails with the following error:
400 Bad Request
{"errorMessages":[],"errors":{"customfield_10044":"Field 'customfield_10044' cannot be set. It is not on the appropriate screen, or unknown."},"reasons":[]}
Why can’t I set the value of a custom field which is defined in the same forge app? Can triggers update issues’ custom field values?