Conversion API

General conversions

There is an amazing feature by which you could find out the converted entities along with their previous entity type just before conversion.
Entity conversions are done with Targetprocess UI. You can convert any entity to any entity type as shown below.

1444

To get the information about the converted entities and their previous entity type, you can use a Get API call as follows:
API v1:

GET /api/v1/generalconversions/

Result is as follows:

<GeneralConversion ResourceType="GeneralConversion" Id="1">
        <FromGeneralID>130791</FromGeneralID>
        <FromGeneralType ResourceType="EntityType" Id="4" Name="UserStory" />
        <ActualGeneral ResourceType="General" Id="191181" Name="[UI] Add &quot;deleted&quot; filter" />
</GeneralConversion>

API v2:

GET /api/v2/generalconversions/?select={Resourcetype,id,FromGeneralType ,FromGeneralID,Actualgeneral}

Result is as follows:

"items": [
        {
            "resourceType": "GeneralConversion",
            "id": 1,
            "fromGeneralType": {
                "resourceType": "EntityType",
                "id": 4,
                "name": "UserStory"
            },
            "fromGeneralID": 130791,
            "actualGeneral": {
                "resourceType": "General",
                "id": 191181,
                "name": "[UI] Add \"deleted\" filter"
            }
        },
…]

📘

Note:

ActualGeneral corresponds to present type created as a result of one or more conversions. If general converted more than one time all records point to last converted General.

FromGeneralType corresponds to the general type it had before conversion.

Find ID of a new entity that was created as a result of conversion, knowing ID of the old entity:

API v1:

GET /api/v1/generalconversions/?where=(FromGeneralID eq 191180)&include=[ActualGeneral[id]]

Result is as follows:

<GeneralConversions>
    <GeneralConversion ResourceType="GeneralConversion" Id="927">
        <ActualGeneral ResourceType="General" Id="191181" />
    </GeneralConversion>
</GeneralConversions>

API v2

GET /api/v2/generalconversions/?where=(Fromgeneralid = 191180)&select={actualgeneral.id}

Result is as follows:

{
    "items": [
        {
            "id": 191181
        }
    ]
}

Find ID of an old entity that was converted, knowing ID of the new entity:

API v1

GET api/v1/generalconversions/?where=(actualgeneral.id eq 191181)&include=[Fromgeneralid,fromgeneraltype]

Result is as follows:

<GeneralConversions>
    <GeneralConversion ResourceType="GeneralConversion" Id="1">
        <FromGeneralID>130791</FromGeneralID>
        <FromGeneralType ResourceType="EntityType" Id="4" Name="UserStory" />
    </GeneralConversion>
    <GeneralConversion ResourceType="GeneralConversion" Id="926">
        <FromGeneralID>130800</FromGeneralID>
        <FromGeneralType ResourceType="EntityType" Id="5" Name="Task" />
    </GeneralConversion>
    <GeneralConversion ResourceType="GeneralConversion" Id="927">
        <FromGeneralID>191180</FromGeneralID>
        <FromGeneralType ResourceType="EntityType" Id="9" Name="Feature" />
    </GeneralConversion>
</GeneralConversions>

API v2:

GET /api/v2/generalconversions/?where=(actualgeneral.id = 191181)&select={Fromgeneralid}

Result is as follows:

{
    "items": [
        {
            "fromGeneralID": 130791
        },
        {
            "fromGeneralID": 130800
        },
        {
            "fromGeneralID": 191180
        }
    ]
}