# \`find-worklist\` with \`LocalAet\` from Modality configuration

**URL:** https://discourse.orthanc-server.org/t/find-worklist-with-localaet-from-modality-configuration/6482
**Category:** General
**Created:** [September 23, 2026, 3:51am UTC](https://discourse.orthanc-server.org/t/find-worklist-with-localaet-from-modality-configuration/6482 "2026-09-23T03:51:03Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![James](https://discourse.orthanc-server.org/letter_avatar_proxy/v4/letter/j/bc8723/32.png) [@James](https://discourse.orthanc-server.org/u/James)
#### Post date: [September 23, 2026, 3:51am UTC](https://discourse.orthanc-server.org/t/find-worklist-with-localaet-from-modality-configuration/6482/1 "2026-09-23T03:51:03Z")

</div>

Dear Orthanc Team,

We use `/modalities` to dynamically create configurations for different connections. We need to customise the `LocalAet` that is used for that modality when using `/modalities/:modalityName/find-worklist`.

In Orthanc \< 1.13.0 this would work well. The local AET used by the Worklist Query would be the `LocalAet` from the modality configuration.

In Orthanc v1.13.0 - from our testing it appears that the local AET used by the same endpoint `/modaliites/:modalityName/find-worklist` is the Orthanc AET - defined globally. I’m not sure if this behaviour was planned.

We investigated and have created 2 patches to address this.

This patch fixes the issue:

```auto
diff --git a/OrthancServer/Sources/OrthancRestApi/OrthancRestModalities.cpp b/OrthancServer/Sources/OrthancRestApi/OrthancRestModalities.cpp
index 896330fcb..31ded7c38 100644
--- a/OrthancServer/Sources/OrthancRestApi/OrthancRestModalities.cpp
+++ b/OrthancServer/Sources/OrthancRestApi/OrthancRestModalities.cpp
@@ -80,11 +80,16 @@ namespace Orthanc
   static DicomAssociationParameters GetAssociationParameters(RestApiPostCall& call,
                                                              const Json::Value& body)
   {
- const std::string& localAet =
- OrthancRestApi::GetContext(call).GetDefaultLocalApplicationEntityTitle();
     const RemoteModalityParameters remote =
       MyGetModalityUsingSymbolicName(call.GetUriComponent("id", ""));
 
+ std::string localAet = OrthancRestApi::GetContext(call).GetDefaultLocalApplicationEntityTitle(); // from the global configuration file
+ if (remote.HasLocalAet()) // from the "DicomModalities" configuration
+ {
+ localAet = remote.GetLocalAet();
+ }
+ localAet = Toolbox::GetJsonStringField(body, KEY_LOCAL_AET, localAet); // from the payload
+
     DicomAssociationParameters params(localAet, remote);
     InjectAssociationTimeout(params, body);
 

```

I have attached a patch for `orthanc-tests` that tests this behaviour. The test succeeds for Orthanc versions \< 1.13.0. and fails for 1.13.0. It passes with the patch above.

[find-worklist-local-aet.patch.txt](https://discourse.orthanc-server.org/uploads/short-url/hjImSSsl58gUQHjUWUtoaKhITSR.txt) (3.9 KB)

I hope this helps and welcome and thoughts/comments.

James
