๐งฉExtract customfields from issue(s)
Introduction
In Jira Cloud, custom fields are managed in a way that allows for flexibility and dynamic creation. Each new custom field that you create within a Jira Cloud instance is assigned a unique ID. This ID is used to identify and manage the custom field's configuration and data within the Jira system.
In this particular case, the library contains multiples helpers method will help you to extract the customfield information by type using the response buffer.
Extract from a single issue
The following methods can be used to extract the customfield information from one issue.
ParseMultiSelectCustomField
This method parses a multi-select custom field from the given buffer data associated with the specified custom field ID and returns a slice of pointers to CustomFieldContextOptionSchema
structs.
ParseSelectCustomField
ParseSelectCustomField parses a select custom field from the given buffer data associated with the specified custom field ID and returns a CustomFieldContextOptionScheme struct
ParseCascadingSelectCustomField
This method parses a cascading custom field from the given buffer data associated with the specified custom field ID and returns a CascadingSelectScheme struct pointer.
ParseDatePickerCustomField
ParseDatePickerCustomField parses the datepicker customfield from the given buffer data associated with the specified custom field ID and returns a struct time.Time value
ParseDateTimeCustomField
ParseDateTimeCustomField parses the datetime customfield from the given buffer data associated with the specified custom field ID and returns a struct time.Time value.
ParseMultiUserPickerCustomField
This method parses a group-picker custom field from the given buffer data associated with the specified custom field ID and returns a slice of pointers to UserDetailScheme structs.
ParseMultiGroupPickerCustomField
This method parses a group-picker custom field from the given buffer data associated with the specified custom field ID and returns a slice of pointers to GroupDetailScheme structs.
ParseFloatCustomField
ParseFloatCustomField parses a float custom field from the given buffer data associated with the specified custom field ID and returns string.
ParseSprintCustomField
ParseSprintCustomField parses a sprints custom field from the given buffer data associated with the specified custom field ID and returns a slice of the SprintDetailScheme struct.
ParseLabelCustomField
ParseLabelCustomField parses a textfield slice custom field from the given buffer data associated with the specified custom field ID and returns string slice.
ParseMultiVersionCustomField
ParseMultiVersionCustomField parses a version-picker custom field from the given buffer data associated with the specified custom field ID and returns a slice of pointers to VersionDetailScheme structs.
ParseUserPickerCustomField
ParseUserPickerCustomField parses a user custom field from the given buffer data associated with the specified custom field ID and returns a struct of UserDetailScheme.
ParseAssetCustomField
ParseAssetCustomField parses the Jira assets elements from the given buffer data associated with the specified custom field ID and returns a struct CustomFieldAssetScheme slice.
ParseStringCustomField
ParseStringCustomField parses a textfield custom field from the given buffer data associated with the specified custom field ID and returns string.
Extract from multiple issues
If you want to extract the customfield values from a buffer of issues, you can use the following methods, it returns a map where the key is the issue key and the value is the customfield values parsed
ParseMultiSelectCustomFields
ParseMultiSelectCustomFields extracts and parses multi-select custom field data from a given bytes.Buffer from multiple issues.
This function takes the name of the custom field to parse and a bytes.Buffer containing JSON data representing the custom field values associated with different issues. It returns a map where the key is the issue key and the value is a slice of CustomFieldContextOptionScheme structs, representing the parsed multi-select custom field values.
The JSON data within the buffer is expected to have a specific structure where the custom field values are organized by issue keys and options are represented within a context.
The function parses this structure to extract and organize the custom field values.
If the custom field data cannot be parsed successfully, an error is returned.
ParseSelectCustomFields
ParseSelectCustomFields extracts and parses select custom field data from a given bytes.Buffer from multiple issues.
This function takes the name of the custom field to parse and a bytes.Buffer containing JSON data representing the custom field values associated with different issues. It returns a map where the key is the issue key and the value is a CustomFieldContextOptionScheme struct, representing the parsed select custom field value.
ParseCascadingCustomFields
ParseCascadingCustomFields extracts and parses a cascading custom field data from a given bytes.Buffer from multiple issues.
This function takes the name of the custom field to parse and a bytes.Buffer containing JSON data representing the custom field values associated with different issues. It returns a map where the key is the issue key and the value is a CascadingSelectScheme struct pointer, representing the parsed cascading custom field value.
ParseMultiUserPickerCustomFields
ParseMultiUserPickerCustomFields extracts and parses a user picker custom field data from a given bytes.Buffer from multiple issues.
This function takes the name of the custom field to parse and a bytes.Buffer containing JSON data representing the custom field values associated with different issues. It returns a map where the key is the issue key and the value is a slice of UserDetailScheme structs, representing the parsed multi-select custom field values.
The JSON data within the buffer is expected to have a specific structure where the custom field values are organized by issue keys and options are represented within a context.
The function parses this structure to extract and organize the custom field values.
If the custom field data cannot be parsed successfully, an error is returned.
ParseDatePickerCustomFields
ParseDatePickerCustomFields extracts and parses the datepicker customfield data from a given bytes.Buffer from multiple issues.
This function takes the name of the custom field to parse and a bytes.Buffer containing JSON data representing the custom field values associated with different issues. It returns a map where the key is the issue key and the value is a time.Time value, representing the parsed datepicker values with the Jira issues.
The JSON data within the buffer is expected to have a specific structure where the custom field values are organized by issue keys and options are represented within a context.
The function parses this structure to extract and organize the custom field values.
If the custom field data cannot be parsed successfully, an error is returned.
ParseDateTimeCustomFields
ParseDateTimeCustomFields extracts and parses the datetime customfield data from a given bytes.Buffer from multiple issues.
This function takes the name of the custom field to parse and a bytes.Buffer containing JSON data representing the custom field values associated with different issues. It returns a map where the key is the issue key and the value is a time.Time value, representing the parsed datetime values with the Jira issues.
The JSON data within the buffer is expected to have a specific structure where the custom field values are organized by issue keys and options are represented within a context.
The function parses this structure to extract and organize the custom field values.
If the custom field data cannot be parsed successfully, an error is returned.
ParseMultiGroupPickerCustomFields
ParseMultiGroupPickerCustomFields extracts and parses a group picker custom field data from a given bytes.Buffer from multiple issues.
This function takes the name of the custom field to parse and a bytes.Buffer containing JSON data representing the custom field values associated with different issues. It returns a map where the key is the issue key and the value is a slice of GroupDetailScheme structs, representing the parsed multi-group custom field values.
The JSON data within the buffer is expected to have a specific structure where the custom field values are organized by issue keys and options are represented within a context.
The function parses this structure to extract and organize the custom field values.
If the custom field data cannot be parsed successfully, an error is returned.
ParseFloatCustomFields
ParseFloatCustomFields extracts and parses the float customfield information from multiple issues using a bytes.Buffer.
This function takes the name of the custom field to parse and a bytes.Buffer containing JSON data representing the custom field values associated with different issues. It returns a map where the key is the issue key and the value is a string representing the parsed float64 customfield value.
The JSON data within the buffer is expected to have a specific structure where the custom field values are organized by issue keys and options are represented within a context.
The function parses this structure to extract and organize the custom field values.
If the custom field data cannot be parsed successfully, an error is returned.
ParseStringCustomFields
ParseStringCustomFields extracts and parses the textfield customfield information from multiple issues using a bytes.Buffer.
This function takes the name of the custom field to parse and a bytes.Buffer containing JSON data representing the custom field values associated with different issues. It returns a map where the key is the issue key and the value is a string representing the parsed textfield customfield value.
The JSON data within the buffer is expected to have a specific structure where the custom field values are organized by issue keys and options are represented within a context.
The function parses this structure to extract and organize the custom field values.
If the custom field data cannot be parsed successfully, an error is returned.
ParseUserPickerCustomFields
ParseUserPickerCustomFields extracts and parses a user custom field data from a given bytes.Buffer from multiple issues.
This function takes the name of the custom field to parse and a bytes.Buffer containing JSON data representing the custom field values associated with different issues. It returns a map where the key is the issue key and the value is a UserDetailScheme struct pointer ,representing the parsed user custom field value.
The JSON data within the buffer is expected to have a specific structure where the custom field values are organized by issue keys and options are represented within a context.
The function parses this structure to extract and organize the custom field values.
If the custom field data cannot be parsed successfully, an error is returned.
ParseSprintCustomFields
ParseSprintCustomFields extracts and parses sprint custom field data from a given bytes.Buffer from multiple issues.
This function takes the name of the custom field to parse and a bytes.Buffer containing JSON data representing the custom field values associated with different issues. It returns a map where the key is the issue key and the value is a slice of SprintDetailScheme structs, representing the parsed sprint custom field values.
The JSON data within the buffer is expected to have a specific structure where the custom field values are organized by issue keys and options are represented within a context.
The function parses this structure to extract and organize the custom field values.
If the custom field data cannot be parsed successfully, an error is returned.
ParseLabelCustomFields
ParseLabelCustomFields extracts and parses the label customfield information from multiple issues using a bytes.Buffer.
This function takes the name of the custom field to parse and a bytes.Buffer containing JSON data representing the custom field values associated with different issues. It returns a map where the key is the issue key and the value is a string slice representing the parsed label customfield value.
The JSON data within the buffer is expected to have a specific structure where the custom field values are organized by issue keys and options are represented within a context.
The function parses this structure to extract and organize the custom field values.
If the custom field data cannot be parsed successfully, an error is returned.
ParseMultiVersionCustomFields
ParseMultiVersionCustomFields extracts and parses a version picker custom field data from a given bytes.Buffer from multiple issues.
This function takes the name of the custom field to parse and a bytes.Buffer containing JSON data representing the custom field values associated with different issues. It returns a map where the key is the issue key and the value is a slice of VersionDetailScheme structs, representing the parsed multi-version custom field values.
The JSON data within the buffer is expected to have a specific structure where the custom field values are organized by issue keys and options are represented within a context.
The function parses this structure to extract and organize the custom field values.
If the custom field data cannot be parsed successfully, an error is returned.
ParseAssetCustomFields
ParseAssetCustomFields extracts and parses jira assets customfield data from a given bytes.Buffer from multiple issues.
This function takes the name of the custom field to parse and a bytes.Buffer containing JSON data representing the custom field values associated with different issues. It returns a map where the key is the issue key and the value is a slice of CustomFieldAssetScheme structs, representing the parsed assets associated with a Jira issues.
Last updated