code: func (i *IssueFields) UnmarshalJSON(data []byte) error {
  
  	// Do the normal unmarshalling first
  	// Details for this way: http://choly.ca/post/go-json-marshalling/
  	type Alias IssueFields
  	aux := &struct {
  		*Alias
  	}{
  		Alias: (*Alias)(i),
  	}
  	if err := json.Unmarshal(data, &aux); err != nil {
  		return err
  	}
  
  	totalMap := tcontainer.NewMarshalMap()
  	err := json.Unmarshal(data, &totalMap)
  	if err != nil {
  		return err
  	}
  
  	t := reflect.TypeOf(*i)
  	for i := 0; i < t.NumField(); i++ {
  		field := t.Field(i)
  		tagDetail := field.Tag.Get("json")
  		if tagDetail == "" {
  			// ignore if there are no tags
  			continue
  		}
  		options := strings.Split(tagDetail, ",")
  
  		if len(options) == 0 {
  			return fmt.Errorf("No tags options found for %s", field.Name)
  		}
  		// the first one is the json tag
  		key := options[0]
  		if _, okay := totalMap.Value(key); okay {
  			delete(totalMap, key)
  		}
  
  	}
  	i = (*IssueFields)(aux.Alias)
  	// all the tags found in the struct were removed. Whatever is left are unknowns to struct
  	i.Unknowns = totalMap
  	return nil
  
  }
docs: // UnmarshalJSON is a custom JSON marshal function for the IssueFields structs.
  // It handles JIRA custom fields and maps those from / to "Unknowns" key.