Hi Harry,
The parameter "trunk_base_project_vrs_id” is a read-only field and cannot be used inside the API call. It also doesn’t have to be used as the value of this parameter will automatically be filled when you use this task.
To solve it, leave out the parameter and construct the body as follows:
POST indicium/iam/sf/start_merge_session
{
"trunk_project_id": "TRUNK_ID",
"trunk_current_project_vrs_id": "2.00",
"branch_project_id": "BRANCH_ID",
"branch_current_project_vrs_id": "1.00",
"merge_direction": 1,
"description": "Merge TRUNK_ID 2.00 into BRANCH_ID 1.00"
}
Hi @Mark Jongeling,
With your solution I've managed to start a merge session however I can’t seem to execute this merge session. Is it possible the API call described in this blogpost has changed? I’ve tried adding and subtracting some parameters but unfortunately to no avail.
Could you point me in the right direction?
Hi Harry,
The task execute_merge_session is not optimized for API use. Due to needing to solve any Conflicts that may appear in your merge sessions, this never was a priority. You can schedule the merge session to be executed if that is a viable alternative for you.
Examples based on merge to Trunk:
To be able to Execute a merge session, you'll have to first stage the task, patch the values and then commit the task:
POST indicium/iam/sf/merge_session((merge_session_id])/execute_merge_session/stage
After staging, Indicium will return what the ID is of the staged resource like this: iam/appl/staged_execute_merge_session(#)
Not required by default but in case you want to change any values:
For each field you need to update, do a patch like so:
PATCH indicium/iam/sf/staged_execute_merge_session(#)
{
"new_project_vrs_id": "2.00"
}
Commit task:
POST indicium/iam/sf/staged_execute_merge_session(#)/commit
This should do the trick although I haven't been able to test this. The code is according to the Docs
Examples based on merge to Trunk:
To be able to Execute a merge session, you'll have to first stage the task, patch the values and then commit the task:
POST indicium/iam/sf/merge_session([merge_session_id])/execute_merge_session/stage
Hi @Mark Jongeling , thank you for your response.
Disappointing to hear that the execute_merge_session is not optimized for API use. We’re trying to automate the process of branching and merging so that we can use this more frequently and with smaller changes and consequently we’re expecting that with small changes in projects the occurrences of merge conflicts won’t be often.
I’ve tried the solution you suggested however when I’m trying to execute:
POST
indicium/iam/sf/merge_session(66)/execute_merge_session/stage
It returns a 401 unauthorized. Are there any additional details I need to add to the body of the request or am I forgetting something else?