Merge Request object
You can use the Merge Request object to create and manage merge requests to merge changes in a development branch to another branch.
Structure
<MergeRequest>
<sourceBranchId/>
<destinationBranchId/>
<strategy/>
<priorityBranch/>
<stage/>
<previousStage/>
<modifiedBy/>
<modifiedDate/>
<createdBy/>
<creadedDate/>
</MergeRequest>
| Field | Type | Description |
|---|---|---|
sourceBranchId | string | The ID of the source branch. |
destinationBranchId | string | The ID of the destination branch. |
strategy | string | The merge strategy: OVERRIDE or CONFLICT_RESOLVE. |
priorityBranch | string | The branch which should take priority in an override merge. |
stage | string | The current stage of the merge: DRAFTING, DRAFTED, REVIEWING, MERGING, MERGED, FAILED_TO_MERGE, or NOT_EXIST. |
previousStage | string | The previous stage of the merge: DRAFTING, DRAFTED, REVIEWING, MERGING, MERGED, FAILED_TO_MERGE, or NOT_EXIST. |
modifiedBy | string | The user who last modified the merge request. |
modifiedDate | dateTime (yyyy-MM-dd'T'HH:mm:ss'Z') | The date and time the merge request was last modified. |
createdBy | string | The user who created the merge request. |
createdDate | dateTime (yyyy-MM-dd'T'HH:mm:ss'Z') | The date and time the merge request was created. |
Supported operations
| GET | QUERY | CREATE | UPDATE | EXECUTE | DELETE |
|---|---|---|---|---|---|
Using the QUERY operation
-
You can query a branch to retrieve a list of all active merge request IDs.
-
You must include the destination or source branch as a parameter. Only EQUALS is allowed for these parameters.
-
Optional paramters include:
createdDatecreatedBystagemodifiedDatemodifiedBy
-
You can use the
queryMorerequest to return more than 100 results.
For more information about query filters, refer to Query filters.
Using the CREATE operation
-
To create a merge request, you need the branch IDs for the source and destination branches. The source branch is the branch you want to merge into the destination branch.
-
There are two merge request strategies you can choose from: OVERRIDE or CONFLICT_RESOLVE. An override merge automatically resolves any merge conflicts by prioritizing the branch specified in the
priorityBranchfield. If you choose the CONFLICT_RESOLVE strategy, you have the opportunity to review any conflicts and choose which version you want to keep.
Using the GET operation
-
The
resolutionparameter is generated from the original merge request and specifies either the source branch for the final content for the merge or the destination. It can have the following values:- OVERRIDE - The source branch has taken priority
- KEEP_DESTINATION - The destination branch has taken priority
-
The
changeTypeparameter is generated from a branch diff that is performed on merge and can be one of the following values:- ADDED - A component was added to the source branch
- MODIFIED - A component was modified in the source branch
- DELETED - A component was deleted in the source branch
Using the EXECUTE operation
-
There are three actions you can choose from when executing a merge request:
- MERGE - Use to start or restart a merge request; the
stagemust be REVIEWING or FAILED_TO_MERGE - REVERT - Use to revert a merge request; the
stagemust be MERGED or DELETED andpreviousStageis MERGED - RETRY_DRAFTING - Use when the merge request
stageis FAILED_TO_DRAFT or FAILED_TO_REDRAFT
- MERGE - Use to start or restart a merge request; the
-
If the merge is successful, the
stageand/orpreviousStagemight be in one of the following stages:- DRAFTING - The merge request is in the queue.
- DRAFTED - The merge request is drafted for review.
- REVIEWING - The merge request is being reviewed.
- MERGING - The merge request is being processed.
- MERGED - The merge request has successfully completed.
- FAILED_TO_MERGE - The merge request failed to merge.
- NOT_EXIST - No previous merge request has been submitted. This stage is typically returned in the
previousStageparameter.
RESTish implmentation
-
GET operation
After performing a merge request between two branches, you can use the merge request’s ID to retrieve more information about the recently performed merge. The following example shows a merge between two branches where something was deleted in the source branch:
Send an HTTP GET to
https://api.boomi.com/api/rest/v1/{accountId}/MergeRequest/{mergeRequestId}where{accountId}is the ID of the authenticating account and{mergeRequestId}is the ID of the merge request.XML response:
<bns:MergeRequest id="TVI6NTA0" sourceBranchId="QjoyMDI1OTk" sourceBranchName="branch-1" destinationBranchId="QjoyMDI1OTg" destinationBranchName="main" strategy="CONFLICT_RESOLVE" stage="MERGED" priorityBranch="SOURCE" previousStage="MERGING" modifiedBy="boomitester1+api@gmail.com" modifiedDate="2024-09-12T13:13:22Z" createdBy="boomitester1+api@gmail.com" createdDate="2024-09-12T13:13:18Z" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bns="http://api.platform.boomi.com/"/>You can also use the GET operation to view a user's current working branch:
Send an HTTP GET to
https://api.boomi.com/api/rest/v1/{accountId}/UserAccountProperty/defaultWorkingBranchwhere the{accountId}is the ID of the account for which you want to view the working branch.XML request response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <bns:UserAccountProperty xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bns="http://api.platform.boomi.com/" propertyName="defaultWorkingBranch" propertyValue="QjoyMDI1OTk"/> -
QUERY operation
Send an HTTP POST to
https://api.boomi.com/api/rest/v1/{accountId}/MergeRequest/querywhere{accountId}is the ID of the authenticating account.JSON request:
{
"QueryFilter": {
"expression": {
"operator": "and",
"nestedExpression": [
{
"argument": [
"MERGED"
],
"operator": "EQUALS",
"property": "stage"
},
{
"argument": [
"QjoxMDU"
],
"operator": "EQUALS",
"property": "sourceBranchId"
},
{
"argument": [
"Qjox"
],
"operator": "EQUALS",
"property": "destinationBranchId"
},
{
"argument": [
"admin@boomi.com"
],
"operator": "EQUALS",
"property": "createdBy"
},
{
"argument": [
"admin@boomi.com"
],
"operator": "EQUALS",
"property": "modifiedBy"
},
{
"argument": [
"2024-05-22T15:11:39Z"
],
"operator": "EQUALS",
"property": "modifiedDate"
},
{
"argument": [
"2024-05-22T15:07:37Z"
],
"operator": "EQUALS",
"property": "createdDate"
}
]
}
}
}JSON response:
{
"@type": "QueryResult",
"result": [
{
"@type": "MergeRequest",
"id": "TVI6Mg",
"sourceBranchId": "QjoxMDU",
"destinationBranchId": "Qjox",
"stage": "MERGED",
"modifiedBy": "admin@boomi.com",
"modifiedDate": "2024-05-22T15:11:39Z",
"createdBy": "admin@boomi.com",
"createdDate": "2024-05-22T15:07:37Z"
}
],
"numberOfResults": 1
} -
CREATE operation
Send an HTTP POST to
https://api.boomi.com/api/rest/v1/{accountId}/MergeRequestwhere{accountId}is the ID of the authenticating account.The following example shows a merge request with the OVERRIDE strategy:
XML request:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<bns:MergeRequest xmlns:bns="http://api.platform.boomi.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" sourceBranchId="QjoyMDI1OTk" destinationBranchId="QjoyMDI1OTg" strategy="OVERRIDE" priorityBranch="SOURCE"/>XML response:
<bns:MergeRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bns="http://api.platform.boomi.com/" id="TVI6NTB9" sourceBranchId="QjoyMDI1OTk" sourceBranchName="branch-1" destinationBranchId="QjoyMDI1OTg" destinationBranchName="main" strategy="OVERRIDE" stage="DRAFTING" priorityBranch="SOURCE" previousStage="NOT_EXIST" modifiedBy="user@boomi.com" modifiedDate="2024-05-17T19:00:30Z" createdBy="user@boomi.com" createdDate="2024-05-17T19:00:30Z"/>The following example shows a merge reqeust with the CONFLICT_RESOLVE strategy:
XML request:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<bns:MergeRequest xmlns:bns="http://api.platform.boomi.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" sourceBranchId="QjoyMDI1OTk" destinationBranchId="QjoyMDI1OTg" strategy="CONFLICT_RESOLVE" priorityBranch="SOURCE"/>XML response:
<bns:MergeRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bns="http://api.platform.boomi.com/" id="TVI6NTA0" sourceBranchId="QjoyMDI1OTk" sourceBranchName="branch-1" destinationBranchId="QjoyMDI1OTg" destinationBranchName="main" strategy="CONFLICT_RESOLVE" stage="DRAFTING" priorityBranch="SOURCE" previousStage="NOT_EXIST" modifiedBy="boomitester1+api@gmail.com" modifiedDate="2024-09-12T13:13:18Z" createdBy="boomitester1+api@gmail.com" createdDate="2024-09-12T13:13:18Z"/> -
UPDATE operation
Send an HTTP POST to
https://api.boomi.com/api/rest/v1/{accountId}/MergeRequest/{mergeRequestId}where{accountId}is the ID of the authenticating account and{mergeRequestId}is the ID of the merge request.XML request:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<bns:MergeRequest xmlns:bns="http://api.platform.boomi.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="TVI6NjY3" strategy="CONFLICT_RESOLVE">
<bns:MergeRequestDetails>
<bns:MergeRequestDetail componentGuid="50e9d4f5-fea6-4ab0-91b1-d8b683ede8c0" resolution="KEEP_DESTINATION"/>
</bns:MergeRequestDetails>
</bns:MergeRequest>XML response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<bns:MergeRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bns="http://api.platform.boomi.com/" id="TVI6NjY3" sourceBranchId="QjoxNTc" sourceBranchName="feature-1" destinationBranchId="Qjo4" destinationBranchName="main" strategy="CONFLICT_RESOLVE" stage="REVIEWING" priorityBranch="SOURCE" previousStage="REVIEWING" modifiedBy="user@boomi.com" modifiedDate="2024-09-12T13:35:58Z" createdBy="user@boomi.com" createdDate="2024-09-12T13:35:17Z" lockedBy="user@boomi.com" lockedDate="2024-09-12T13:35:57Z" lockNonce="3891734813466242810">
<bns:MergeRequestDetails>
<bns:MergeRequestDetail componentGuid="50e9d4f5-fea6-4ab0-91b1-d8b683ede8c0" sourceRevision="8" destinationRevision="7" changeType="MODIFIED" conflict="true" resolution="KEEP_DESTINATION" stage="DRAFTED" modifiedBy="user@boomi.com" modifiedDate="2024-09-12T13:35:58Z" createdBy="user@boomi.com" createdDate="2024-09-12T13:35:18Z"/>
</bns:MergeRequestDetails>
</bns:MergeRequest> -
EXECUTE operation
Send an HTTP POST to
https://api.boomi.com/api/rest/v1/{accountId}/MergeRequest/execute/{mergeRequestId}where{accountId}is the ID of the authenticating account and{mergeRequestId}is the ID of the merge request you want to execute.XML request:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<bns:MergeRequest xmlns:bns="http://api.platform.boomi.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="TVI6NTQ5" mergeRequestAction="MERGE">
</bns:MergeRequest>XML response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<bns:MergeRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bns="http://api.platform.boomi.com/" id="TVI6NTQ5" sourceBranchId="QjoyMDI1OTk" sourceBranchName="branch-1" destinationBranchId="QjoyMDI1OTg" destinationBranchName="main" strategy="OVERRIDE" stage="MERGING" priorityBranch="DESTINATION" previousStage="REVIEWING" modifiedBy="anuja.verma@boomi.com" modifiedDate="2024-09-24T13:15:27Z" createdBy="user@boomi.com" createdDate="2024-09-24T05:36:59Z">
<bns:MergeRequestDetails>
<bns:MergeRequestDetail componentGuid="b6fc8152-bfbe-44b7-b96b-4959db06e23a" sourceRevision="2" changeType="ADDED" conflict="false" stage="DRAFTED" modifiedBy="user@boomi.com" modifiedDate="2024-09-24T13:15:23Z" createdBy="user@boomi.com" createdDate="2024-09-24T13:15:23Z"/>
</bns:MergeRequestDetails>
</bns:MergeRequest> -
DELETE operation
Send an HTTP DELETE to
https://api.boomi.com/api/rest/v1/{accountId}/MergeRequest/{mergeId}where{accountId}is the ID of the authenticating account and{mergeId}is the ID of the merge request you want to delete.If the deletion was successful, you receive a response of
<true/>.