2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/tessitura_rest/crm/issues.rb', line 2
def create_issue(activity_type, category_id, constituent_id, contact_type, notes, origin_id, options = {})
parameters =
{
'ActivityType': {
'Id': activity_type,
'Category': {
'Id': category_id,
},
},
'ContactType': {
'Id': contact_type,
},
'Constituent': {
'Id': constituent_id,
},
'Origin': {
'Id': origin_id,
},
'Notes': notes,
}
parameters.delete(:Origin) unless origin_id.present?
options.merge!(basic_auth: @auth, headers: @headers)
options.merge!(:body => parameters)
response = self.class.post(base_api_endpoint('CRM/Issues'), options)
JSON.parse(response.body)
end
|