# Merge services using API, rules doesn't work

**URL:** <https://community.dynatrace.com/t/merge-services-using-api-rules-doesnt-work/20793>\
**Category:** Dynatrace API\
**Tags:** services-classic, dynatrace-api\
**Created:** [November 12, 2020, 3:43pm UTC](https://community.dynatrace.com/t/merge-services-using-api-rules-doesnt-work/20793 "2020-11-12T15:43:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Santosh](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@Santosh](https://community.dynatrace.com/u/Santosh)\
**Post date:** [November 12, 2020, 3:43pm UTC](https://community.dynatrace.com/t/merge-services-using-api-rules-doesnt-work/20793/1 "2020-11-12T15:43:26Z")

</div>

I have tried to merge the services which are belongs to one process group, same context root and same application id but different web server name. I tried to valueOverride for server but rule doesn’t get affected. Please suggest below is the rule

{

“type”: “FULL\_WEB\_REQUEST”,

“managementZones”: [],

“name”: “SOA-XXXX\_Merge”,

“description”: “Merge the SOA -XXXX service”,

“enabled”: true,

“conditions”: [

{

“attributeType”: “CONTEXT\_ROOT”,

“compareOperations”: [

{

“type”: “EQUALS”,

“negate”: false,

“ignoreCase”: false,

“values”: [

“/soa-infra/services/default/XXXX”

]

}

]

}

],

“applicationId”: null,

“contextRoot”: null,

“serverName”: {

“valueOverride”: “ABCD\_WebServer”

}

}

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [November 12, 2020, 4:44pm UTC](https://community.dynatrace.com/t/merge-services-using-api-rules-doesnt-work/20793/2 "2020-11-12T16:44:19Z")

</div>

It looks valid. Are you sure you are comparing to a good value in your condition and you have a good type (FULL\_WEB\_REQUEST)?  
Just a reminder - it is applied only for new requests from the time the API detection rule has been applied.

---

<div class="post-metadata">

**Author:** ![Santosh](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@Santosh](https://community.dynatrace.com/u/Santosh)\
**Post date:** [November 12, 2020, 5:21pm UTC](https://community.dynatrace.com/t/merge-services-using-api-rules-doesnt-work/20793/3 "2020-11-12T17:21:59Z")

</div>

I am comparing the Context\_Root value as exactly showing in metadata of service. Also kept under observation for couple of days which turns some more request to receive.

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [November 12, 2020, 5:51pm UTC](https://community.dynatrace.com/t/merge-services-using-api-rules-doesnt-work/20793/4 "2020-11-12T17:51:21Z")

</div>

DId you try to replace EQUALS to STRING\_EQUALS ? I did not notice it at the first sight. Context root is a string, so I guess STRING\_EQUALS should the right compare operation to choose.

---

<div class="post-metadata">

**Author:** ![Santosh](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@Santosh](https://community.dynatrace.com/u/Santosh)\
**Post date:** [November 13, 2020, 9:17am UTC](https://community.dynatrace.com/t/merge-services-using-api-rules-doesnt-work/20793/5 "2020-11-13T09:17:55Z")

</div>

I tried to change STRING\_EQUALS but it is automatically changing value to EQUALS. Even i tried to create new rule but same once I submit request then value is auto changed to EQUALS.

---

<div class="post-metadata">

**Author:** ![Santosh](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@Santosh](https://community.dynatrace.com/u/Santosh)\
**Post date:** [November 13, 2020, 11:46am UTC](https://community.dynatrace.com/t/merge-services-using-api-rules-doesnt-work/20793/6 "2020-11-13T11:46:48Z")

</div>

Below is service type and technology, where i am trying this rule. Hope it supports

| Service type | Web request service |
| --- | --- |
| Service main technology | Oracle WebLogic |

---

<div class="post-metadata">

**Author:** ![Santosh](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@Santosh](https://community.dynatrace.com/u/Santosh)\
**Post date:** [November 17, 2020, 8:50am UTC](https://community.dynatrace.com/t/merge-services-using-api-rules-doesnt-work/20793/7 "2020-11-17T08:50:09Z")

</div>

Thanks for your help,

Actual problem is, someone already created the rule to change the contextroot from it’s original value. So rule created is not matching the value provided for contextroot, as the original value is something else.

I have increased the order and updated the original contextroot value and it did worked.
