AI agents can edit fields and upload attachments on a shared work item

Description

Follow-up to ESFJ-2558. The ?mode=ai model of a work item share offers two new actions. Like add_comment and change_status, both are offered only when the share has "Allow agent actions" on. Each call goes through the same checks: the link, the password, the rate limit and the Idempotency-Key.

  1. edit_fields (POST /issue/{uuid}/ai/fields) changes the fields the share lets visitors edit: summary, description, selects, multi-selects, cascading selects, labels, users, numbers, dates, date-times, text and URL fields.

    • The model lists them in content.issue.editableFields. Each one has its kind and whether it is required.

    • Options are given by index ids. Option names appear only inside the untrusted-text fence, never in the input schema.

    • Fields that the project of the work item does not let visitors edit are left out.

    • The values go through the same save as the share page, so the same Jira validation, required-field checks and activity entry ("via AI agent") apply.

    • Text is checked for secrets. Rich text replaces the whole field.

    • New error codes: FIELDS_NOT_ALLOWED, FIELD_NOT_EDITABLE.

  2. upload_attachment (POST /issue/{uuid}/ai/attachments, {fileName, contentBase64}) adds an attachment when the share lets visitors add attachments.

    • Files are limited to 5 MB and to these extensions: txt, log, md, csv, json, pdf, png, jpg, jpeg, gif, webp. The MIME type comes from the extension.

    • Text files and the file name are checked for secrets.

    • The file is decoded only after the share checks pass.

    • New error codes: ATTACHMENTS_NOT_ALLOWED, ATTACHMENT_TOO_LARGE (413), UNSUPPORTED_FILE_TYPE.

  3. Agent writes on /issue/*/ai/* have an 8 MB request body limit.

  4. Vote and watch stay unavailable to agents. Both need a signed-in visitor, so vote is still listed as LOGIN_REQUIRED.

  5. The share page now uses the same field-edit and attachment-upload code as the agent endpoints, extracted into IssueFieldEdit and ShareAttachmentUpload. Editing and uploading on the share page should work as before.

Docs: the AI share model spec needs the two actions, the new error codes, editableFields and the body limit.

Linked work items

relates to
Work Item Type Icon ESFJ-2558 AI data model for the shared page Priority: Lowest Assignee:
Released
Work Item Type Icon ESFJ-2551 ESFJ AIness Priority: Lowest Assignee:
Done
Work Item Type Icon ESFJ-2632 AI agent cannot access password-protected shares Priority: Lowest Assignee:
Released