module Teamlab::CrmTags

Methods for working with crm cases

Public Instance Methods

add_contact_tag_to_group(entity_type, entity_id, tag) click to toggle source
# File lib/teamlab/modules/crm/crm_tags.rb, line 50
def add_contact_tag_to_group(entity_type, entity_id, tag)
  @request.post([entity_type.to_s, entity_id.to_s, 'tag', 'group'], tagName: tag)
end
add_tag(entity_type, entity_id, tag_name) click to toggle source
# File lib/teamlab/modules/crm/crm_tags.rb, line 34
def add_tag(entity_type, entity_id, tag_name)
  @request.post([entity_type.to_s, entity_id.to_s, 'tag'], tagName: tag_name)
end
add_tag_group_to_entity(entity_type, entity_id, tag_name) click to toggle source
# File lib/teamlab/modules/crm/crm_tags.rb, line 26
def add_tag_group_to_entity(entity_type, entity_id, tag_name)
  @request.post([entity_type.to_s, 'taglist'], entityId: entity_id, tagName: tag_name)
end
add_tag_to_case_group_by_filter(tag_name, options = {}) click to toggle source
# File lib/teamlab/modules/crm/crm_tags.rb, line 22
def add_tag_to_case_group_by_filter(tag_name, options = {})
  @request.post(%w[case filter taglist], { tagName: tag_name }.merge(options))
end
add_tag_to_opportunity_group(tag_name, options = {}) click to toggle source
# File lib/teamlab/modules/crm/crm_tags.rb, line 30
def add_tag_to_opportunity_group(tag_name, options = {})
  @request.post(%w[opportunity filter taglist], { tagName: tag_name }.merge(options))
end
create_tag(entity_type, tag_name) click to toggle source
# File lib/teamlab/modules/crm/crm_tags.rb, line 18
def create_tag(entity_type, tag_name)
  @request.post([entity_type.to_s, 'tag'], tagName: tag_name)
end
delete_tag(entity_type, tag_name) click to toggle source
# File lib/teamlab/modules/crm/crm_tags.rb, line 38
def delete_tag(entity_type, tag_name)
  @request.delete([entity_type.to_s, 'tag'], tagName: tag_name)
end
delete_unused_tags(entity_type) click to toggle source
# File lib/teamlab/modules/crm/crm_tags.rb, line 42
def delete_unused_tags(entity_type)
  @request.delete([entity_type.to_s, 'tag', 'unused'])
end
get_all_contact_tags(contact_id) click to toggle source
# File lib/teamlab/modules/crm/crm_tags.rb, line 10
def get_all_contact_tags(contact_id)
  @request.get(['contact', contact_id.to_s, 'tag'])
end
get_entity_tags(entity_type, entity_id) click to toggle source
# File lib/teamlab/modules/crm/crm_tags.rb, line 14
def get_entity_tags(entity_type, entity_id)
  @request.get([entity_type.to_s, 'tag', entity_id.to_s])
end
get_tags_for_entity_type(entity_type) click to toggle source
# File lib/teamlab/modules/crm/crm_tags.rb, line 6
def get_tags_for_entity_type(entity_type)
  @request.get([entity_type.to_s, 'tag'])
end
remove_tag(entity_type, entity_id, tag_name) click to toggle source
# File lib/teamlab/modules/crm/crm_tags.rb, line 46
def remove_tag(entity_type, entity_id, tag_name)
  @request.delete([entity_type.to_s, entity_id.to_s, 'tag'], tagName: tag_name)
end