# Custom Conflict Resolution Strategy

Custom Conflict Resolution Strategy assists user in making complex resolution decisions based on the run time values in the source and target systems. With this strategy, users can resolve conflict by considering which end point was updated last or which end point was updated first. User can also make the master/slave decision at run time, based on the current state of the end systems. For example, whether the end system in which a workitem is still open becomes the master or a system in which workitem was not created by sync becomes the master and so on.

***

## Steps to provide XSLT for defining Custom Strategy

Given below are steps to provide XSLT for custom strategy:

* Click the edit adjacent to the **Custom Strategy** drop-down option.

<div align="center"><img src="/files/QniReni3u0oWQVF3Qmy0" alt="" width="1000"></div>

* Remove comments and provide XSLT in the open box.

<div align="center"><img src="/files/OezX7OxDBr9Ikk8Gx1Yh" alt="" width="400"></div>

***

### Field Value Access Table

| Description                              | Example                                                                                                                                    |
| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| **You can access the source old value:** | <p><code>SourceXML/sourceSystemOld/Property/$FieldName$</code><br><em>$FieldName$ is the internal name of the source system field</em></p> |
| **You can access the source new value:** | <p><code>SourceXML/sourceSystemNew/Property/$FieldName$</code><br><em>$FieldName$ is the internal name of the source system field</em></p> |
| **You can access the target value:**     | <p><code>SourceXML/targetSystem/Property/$FieldName$</code><br><em>$FieldName$ is the internal name of the target system field</em></p>    |

***

### Example

For example, take that resolution strategy for Title field is 'master system is selected based on originated-in system.'\
We can provide the script:

```xml
<Title>
  <xsl:variable xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="xPathVariable" select="SourceXML/sourceSystemNew/Property/Created-space-By/userEmail"/>
  <xsl:choose xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:when test="$xPathVariable='test@opshub.com'">
      <xsl:value-of select="SourceXML/targetSystem/Property/Title"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="SourceXML/sourceSystemNew/Property/Title"/>
    </xsl:otherwise>
  </xsl:choose>
</Title>
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://opstech.gitbook.io/opstech-docs/7.223/integrate/configure-integrations/mapping-configuration/custom-conflict-resolution-strategy.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
