How can I set custom fields on issue creation? #346
Locked
ankitpokhrel
announced in
FAQs
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Jira supports a wide variety of datatypes when creating a custom field. Out of all formats mentioned in the Jira doc, the tool right now doesn't support
Cascading select custom field
,Single-user picker custom field
andMulti-user picker custom field
. Support for these missing types will be added based on the request and the usecase.Details
The initialization process adds a section
issue.fields.custom
in the config to save required details about configured custom fields. You can only set custom fields that are available in the config. If any custom field is missing, you will have to re-generate the config or add the missing details manually.You can use
--custom
flag to set values for custom fields. This flag accepts a key-value pair. The key is derived from thename
you see in the configuration. This is the same name that you see in the UI making it easy to guess. Dash/hyphen (-
) separated lowercasename
is used as a key. The value depends on the datatype of the field. For some datatypes likestring
,datetime
,date
,option
, the value is a plain string (eg:--custom note="An example note"
). For array types, its a comma separated value (eg:--custom platform=iOS,Android
).Example
Given some custom fields as below:
You can use
--custom
flag to pass data for custom fieldsThe example command above creates a
story
with defined custom fields of different types as seen in the screenshot below.Caveats
The Jira API returns invalid types for some locked custom fields. For instance, for the
sprint
field the returned datatype is an array of strings or JSON depending on the Jira version used. However, that is not true since the create API expects a single numeric value for a sprint field.In such cases, the config needs to be modified manually to make the field work.
Beta Was this translation helpful? Give feedback.
All reactions