getEditIssueMeta method

Future<IssueUpdateMetadata> getEditIssueMeta({
  1. required String issueIdOrKey,
  2. bool? overrideScreenSecurity,
  3. bool? overrideEditableFlag,
})

Returns the edit screen fields for an issue that are visible to and editable by the user. Use the information to populate the requests in Edit issue.

This endpoint will check for these conditions:

  1. Field is available on a field screen - through screen, screen scheme, issue type screen scheme, and issue type scheme configuration. overrideScreenSecurity=true skips this condition.
  2. Field is visible in the field configuration. overrideScreenSecurity=true skips this condition.
  3. Field is shown on the issue: each field has different conditions here. For example: Attachment field only shows if attachments are enabled. Assignee only shows if user has permissions to assign the issue.
  4. If a field is custom then it must have valid custom field context, applicable for its project and issue type. All system fields are assumed to have context in all projects and all issue types.
  5. Issue has a project, issue type, and status defined.
  6. Issue is assigned to a valid workflow, and the current status has assigned a workflow step. overrideEditableFlag=true skips this condition.
  7. The current workflow step is editable. This is true by default, but can be disabled by setting the jira.issue.editable property to false. overrideEditableFlag=true skips this condition.
  8. User has Edit issues permission.
  9. Workflow permissions allow editing a field. This is true by default but can be modified using jira.permission.* workflow properties.

Fields hidden using Issue layout settings page remain editable.

Connect apps having an app user with Administer Jira global permission, and Forge apps acting on behalf of users with Administer Jira global permission, can return additional details using:

  • overrideScreenSecurity When this flag is true, then this endpoint skips checking if fields are available through screens, and field configuration (conditions 1. and 2. from the list above).
  • overrideEditableFlag When this flag is true, then this endpoint skips checking if workflow is present and if the current step is editable (conditions 6. and 7. from the list above).

This operation can be accessed anonymously.

Permissions required:

Note: For any fields to be editable the user must have the Edit issues project permission for the issue.

Implementation

Future<IssueUpdateMetadata> getEditIssueMeta(
    {required String issueIdOrKey,
    bool? overrideScreenSecurity,
    bool? overrideEditableFlag}) async {
  return IssueUpdateMetadata.fromJson(await _client.send(
    'get',
    'rest/api/3/issue/{issueIdOrKey}/editmeta',
    pathParameters: {
      'issueIdOrKey': issueIdOrKey,
    },
    queryParameters: {
      if (overrideScreenSecurity != null)
        'overrideScreenSecurity': '$overrideScreenSecurity',
      if (overrideEditableFlag != null)
        'overrideEditableFlag': '$overrideEditableFlag',
    },
  ));
}