You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] channelName variable is not available in Postprocessor script #309
Describe the bug
The channelName variable is not available in the Postprocessor script. It makes no sense that is not available, since it is available for the Deploy, Undeploy and Preprocessor scripts.
To Reproduce
Create a channel with a Postprocessor script that makes use of the channelName variable.
Send a message to the channel and observe that the variable does not exist.
Expected behavior
The variable channelName should be available in the Postprocessor script.
Actual behavior
The variable channelName is not available in the Postprocessor script.
Workaround(s)
Obtain the channel name in other place that where is available and store it in another variable that the Postprocessor script has access to.
Additional context
There was already a bug report for Mirth Connect, but it was automatically closed without a fix: nextgenhealthcare/connect#3893
Confirmed on current main: JavaScriptScopeUtil.getPostprocessorScope reads channelName from message.getMergedConnectorMessage().getChannelName(), but Message.getMergedConnectorMessage() never populates channelName on the merged connector message — so the variable resolves to null only in the Postprocessor scope, exactly as reported:
@giomedcontext's withdrawn #325 had the right fix (populate it from the Message's own field, falling back to the source connector message). @giomedcontext — do you plan to resubmit? If not, I'm happy to pick it up: same approach, rebased on the Gradle layout, with a regression test, credited to you.
Activity
e210 commentedon Jul 29, 2026
Confirmed on current
main:JavaScriptScopeUtil.getPostprocessorScopereadschannelNamefrommessage.getMergedConnectorMessage().getChannelName(), butMessage.getMergedConnectorMessage()never populateschannelNameon the merged connector message — so the variable resolves to null only in the Postprocessor scope, exactly as reported:engine/donkey/src/main/java/com/mirth/connect/donkey/model/message/Message.java
Lines 116 to 122 in 776690e
@giomedcontext's withdrawn #325 had the right fix (populate it from the
Message's own field, falling back to the source connector message). @giomedcontext — do you plan to resubmit? If not, I'm happy to pick it up: same approach, rebased on the Gradle layout, with a regression test, credited to you.ggiannola commentedon Jul 29, 2026
@e210 I created a new PR to fix this: #395
Fix OpenIntegrationEngine#309: make channelName available in Postproc…
Fix OpenIntegrationEngine#309: make channelName available in Postproc…
Fix OpenIntegrationEngine#309: make channelName available in Postproc…