Skip to content

issue create --custom cannot set option-type custom fields #1027

Description

@GromNaN

Is your feature request related to a problem? Please describe.
jira issue create --custom ignores option-type custom fields, so creating an issue whose create screen requires one returns a 400 <field> is required. For example, with an option custom field Reason (customfield_12345) declared in .config.yml, running:

jira issue create -p PROJ -t Task -s "Summary" -b "Description" --custom 'Reason=Some Value' --no-input

prints "Invalid custom fields used in the command: Reason", does not send the field, and Jira returns 400 The field 'Reason' is required.

Describe the solution you'd like
jira issue create --custom should support Select / option-type custom fields declared in the config custom fields, accepting either the option id or the option value, so the field is sent with the issue and the issue is created.

Describe alternatives you've considered
Passing the raw key or a JSON object did not help. Each of these variants produces the same "Invalid custom fields used in the command: Reason" result:

  • --custom customfield_12345=123
  • --custom "Reason=Some Value"
  • --custom 'Reason={"id":"123"}'
  • --custom "Reason=123"

Additional context
jira-cli version 1.7.0. The field is declared under issue.fields.custom in .config.yml as name: Reason, key: customfield_12345, schema.datatype: option.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions