// GetCustomFields returns a map of customfield_* keys with string values
333974
func (s *IssueService) GetCustomFields(issueID string) (CustomFields, *Response, error) {
	apiEndpoint := fmt.Sprintf("rest/api/2/issue/%s", issueID)
	req, err := s.client.NewRequest("GET", apiEndpoint, nil)
	if err != nil {
		return nil, nil, err
	}

	issue := new(map[string]interface{})
	resp, err := s.client.Do(req, issue)
	if err != nil {
		jerr := NewJiraError(resp, err)
		return nil, resp, jerr
	}

	m := *issue
	f := m["fields"]
	cf := make(CustomFields)
	if f == nil {
		return cf, resp, nil
	}

	if rec, ok := f.(map[string]interface{}); ok {
		for key, val := range rec {
			if strings.Contains(key, "customfield") {
				if valMap, ok := val.(map[string]interface{}); ok {
					if v, ok := valMap["value"]; ok {
						val = v
					}
				}
				cf[key] = fmt.Sprint(val)
			}
		}
	}
	return cf, resp, nil
}
1012724
func GetFields(body []byte) ([]string, error) {
	query, err := pql.ParseString(string(body))
	if err != nil {
		return nil, fmt.Errorf("parsing query: %v", err.Error())
	}

	fields := make([]string, len(query.Calls))

	for i, call := range query.Calls {
		if field, ok := call.Args["field"].(string); ok {
			fields[i] = field
		} else if field, ok := call.Args["_field"].(string); ok {
			fields[i] = field
		} else {
			fields[i] = ""
		}
	}
	return fields, nil
}
374678
func getGlobalFieldMappings() []*types.EventFieldMapping {
	return []*types.EventFieldMapping{
		{
			ColumnName: types.SQLColumnLabelHeight,
			Field:      types.BlockHeightLabel,
			Type:       types.EventFieldTypeString,
		},
		{
			ColumnName: types.SQLColumnLabelTxHash,
			Field:      types.TxTxHashLabel,
			Type:       types.EventFieldTypeString,
		},
		{
			ColumnName: types.SQLColumnLabelEventType,
			Field:      types.EventTypeLabel,
			Type:       types.EventFieldTypeString,
		},
		{
			ColumnName: types.SQLColumnLabelEventName,
			Field:      types.EventNameLabel,
			Type:       types.EventFieldTypeString,
		},
	}
}
892853
func (v *CrazyNesting) GetListField() (o [][]struct {
	Key   map[int32]struct{}
	Value map[int32][][][]struct {
		Key   *Insanity
		Value string
	}
}) {
	if v != nil {
		o = v.ListField
	}
	return
}
115291
func (eng *engine) FindFields(keys KeyList, container TableListContainer, fields ...string) error {
	s := eng.newSession()
	defer s.Close()
	action, err := s.find(keys, container, getOptions{}, fields)
	if err != nil {
		return s.catch("Find: "+action, err)
	}
	return nil
}
166975
func NonConvertibleFields(annotations map[string]string) map[string]string {
	nonConvertibleKeys := map[string]string{}
	for key, value := range annotations {
		if strings.HasPrefix(key, core.NonConvertibleAnnotationPrefix) {
			nonConvertibleKeys[key] = value
		}
	}
	return nonConvertibleKeys
}
412799
func (t *MetaIssueType) GetAllFields() (map[string]string, error) {
	ret := make(map[string]string)
	for key := range t.Fields {

		name, err := t.Fields.String(key + "/name")
		if err != nil {
			return nil, err
		}
		ret[name] = key
	}
	return ret, nil
}
656276
func GetFieldTag(obj interface{}, fieldName, tagKey string) (string, error) {
	field, err := getInnerFieldType(obj, fieldName)
	if err != nil {
		return "", err
	}

	if !isExportableField(field) {
		return "", errors.New("Cannot GetFieldTag on a non-exported struct field")
	}

	return field.Tag.Get(tagKey), nil
}
1090902
func (eng *engine) GetFields(table Table, fields ...string) (bool, error) {
	s := eng.newSession()
	defer s.Close()
	action, ok, err := s.get(table, getOptions{}, fields...)
	if err != nil {
		return ok, s.catch("Get: "+action, err)
	}
	return ok, nil
}
994763
func GetSortedKeys(m interface{}) []string {
	mapVal := reflect.ValueOf(m)
	keyVals := mapVal.MapKeys()
	keys := []string{}
	for _, keyVal := range keyVals {
		keys = append(keys, keyVal.String())
	}
	sort.Strings(keys)
	return keys
}
629894
func (c *Config) GetFields() []string {
	var names []string
	for k := range c.fields.dict() {
		names = append(names, k)
	}
	return names
}
1287839
func (m fieldMap) getTraversals(names []string) [][]int {
	var traversals [][]int
	for _, name := range names {
		f, ok := m[name]
		if !ok {
			panic(fmt.Errorf("db field '%s' has no mapping", name))
		}
		traversals = append(traversals, f.Index)
	}
	return traversals
}
1304652
func getFields(vObj reflect.Value) []field {
	if vObj.Kind() != reflect.Struct {
		return nil
	}
	ret := []field{}
	for i := 0; i < vObj.Type().NumField(); i++ {
		if vObj.Type().Field(i).Anonymous {
			// in the case of an embedded type that is an alias to interface, extract the
			// real type contained by the interface
			realObj := reflect.ValueOf(vObj.Field(i).Interface())
			ret = append(ret, getFields(realObj)...)
		} else {
			ret = append(ret, field{Type: vObj.Type().Field(i), Value: vObj.Field(i)})
		}
	}
	return ret
}
1248028
func (s *RedisMapStore) GetFields(key string, fields ...string) (interface{}, error) {
	if !strings.HasPrefix(key, s.prefix) {
		key = s.prefix + key
	}
	result, err := s.client.HMGet(key, fields...).Result()
	if err == redis.Nil {
		return nil, errors.NewErrNotFound(key)
	}
	if err != nil {
		return nil, err
	}
	res := make(map[string]string)
	for i, field := range fields {
		if str, ok := result[i].(string); ok {
			res[field] = str
		}
	}
	i, err := s.decoder(res)
	if err != nil {
		return nil, err
	}
	return i, nil
}
630593
func (s *ServerV2) GetCmdLabels() map[string]CommandLabel {
	if s.Spec.CmdLabels == nil {
		return nil
	}
	out := make(map[string]CommandLabel, len(s.Spec.CmdLabels))
	for key := range s.Spec.CmdLabels {
		val := s.Spec.CmdLabels[key]
		out[key] = &val
	}
	return out
}
67750
func (c *Card) CustomFields(boardCustomFields []*CustomField) map[string]interface{} {

	cfm := c.customFieldMap

	if cfm == nil {
		cfm = &(map[string]interface{}{})

		// bcfOptionNames[CustomField ID] = Custom Field Name
		bcfOptionNames := map[string]string{}

		// bcfOptionsMap[CustomField ID][ID of the option] = Value of the option
		bcfOptionsMap := map[string]map[string]interface{}{}

		for _, bcf := range boardCustomFields {
			bcfOptionNames[bcf.ID] = bcf.Name
			for _, cf := range bcf.Options {
				// create 2nd level map when not available yet
				map2, ok := bcfOptionsMap[cf.IDCustomField]
				if !ok {
					map2 = map[string]interface{}{}
					bcfOptionsMap[bcf.ID] = map2
				}

				bcfOptionsMap[bcf.ID][cf.ID] = cf.Value.Text
			}
		}

		for _, cf := range c.CustomFieldItems {
			name := bcfOptionNames[cf.IDCustomField]

			// create 2nd level map when not available yet
			map2, ok := bcfOptionsMap[cf.IDCustomField]
			if !ok {
				continue
			}
			value, ok := map2[cf.IDValue]

			if ok {
				(*cfm)[name] = value
			}
		}
		c.customFieldMap = cfm
	}
	return *cfm
}
404346
func GetFieldTypes(db *sql.DB, dbName string, tableName string) []FieldType {
	fields := GetFields(db, dbName, tableName)
	if fields == nil {
		return nil
	}
	types := make([]FieldType, len(fields))
	for i, f := range fields {
		types[i] = f.Type
	}
	return types
}