The CreatorCon Call for Content is officially open! Get started here.

Inbound web service that can both create and update incidents?

peterraeves
Mega Guru

We are creating an Inbound Web Service that can do 3 things. Create, update and close an Incident. What would best practice be here? Should I create 3 services? Should I create a single Service with 3 transform maps? Should I create a single service with a single TM that covers all situations?

I thought about all situations but all of them had bad points to them. So I thought I'd turn to you guys who are much smarter than me.

1. 3 Services & 3 Transform Maps

+: Easier for the external customer, as the name of the service is clear and they will receive only a single result

-: Double work for field maps/values that are the same for all services

2. 1 Service & 3 Transform Maps

+: Single interface, so customer does not need to worry about what to call

+: Only need maps for those fields that are needed for the current service

-: The external customer will receive the results of 3 TMs

-: All TMs need onBefore maps to check whether they should run

-: Double work for field maps/values that are the same for all services

3. 1 Service & 1 Transform Map

+: Everything is centralized

-: Cannot use coalesce field 'number', because it will not be present when creating a new ticket. This will cause the TM to fail.

PS: As a bonus question, where should I put default values. For example, for the contact_type field, I'd like to enter 'Automated Event', which is not the overal default. Where would I put this assignment? Field Map? Transform Script?

1 ACCEPTED SOLUTION

If you check 'Coalesce Empty Field' it'll stop complaining.   That's what we do and it has worked for 2 years now.   If you don't have a coalesce field, how is it going to know what to update?   Even with Table API, you have to pass something to tell it what to update.


View solution in original post

11 REPLIES 11

This is how I have my coalesce field set up:


find_real_file.png



It works for insert into the transform table and correctly inserts into incident if no reference sys_id is given, and updates if one is.


I see. It seems I forgot to set coalesce empty fields... Setting coalesce empty fields to true does indeed give different results... Sorry about that! Now, we are getting somewhere.