Skip Navigation
Expand
Message base value reflects value from other interface
Answer ID 12814   |   Last Review Date 04/16/2024

Why is my custom CPM code using the message base value for interface A when the incident being processed is from interface B?

Environment:

Connect for PHP (CPHP) API

Issue:

We send emails using CPM customizations, and the content of the email is built using the message base. The problem is, in some cases we have an incident that was created from our ES interface, but where the escalation-triggered synchronous CPM was later executed against the (other) FR interface. When this occurs, this results in the message base value in the wrong language being sent in emails.
 
Is it a normal behavior (incident created in one interface and escalation from another interface)? Is there a way to ensure the correct message base is used 100% of the time the synchronous CPM is called?

Resolution:

The CPHP API will automatically obtain the message base value for the interface the PHP/server process is running on, and this is expected behavior. For example, in the case of synchronous CPMs triggered by incident business rules (escalation rules or otherwise), whatever process is triggering the rule will also run the CPM. This includes any site utilities that might trigger a (synchronous) CPM, in that the interface the utility is running on will determine which interface-specific message base value will be obtained and used in processing.
 
For example, in a case where legacy business rules (that trigger synchronous CPMs) are being triggered through escalation rules, this will be done using the dbstatus-r utility, which is mapped to the primary interface of the site. We would expect, then, that any time a synchronous CPM is triggered by this utility, that the message base values obtained and used by the CPM(s) will be from that primary interface.
 
In the case asked about, the following might be used to obtain the desired behavior:
 
a) Either hard code the message base values in the CPM code, or keep separate message bases for each language used on the site (because the API fetch will automatically get the value for the interface the process is running on)
 
b) Use the interface ('Interface' field) value on the incident to determine which value to use (which message base to look up etc.)
 
Further further details that may also be helpful see