Loading...
New Winner – Cross-Border Excellence | Payoneer India 2026 Check out
Featured Recognized by Salesforce; Proven by impact! Check out

In this concluding blog on BitBucket integration in Salesforce, we’ll proceed with the final step of pushing changes to the Bitbucket Repository for the ultimate deployment. The steps of creating the Apex class and LWC component for final deployment were covered in the previous blog.

So, Let’s get started with the final process without further delay.

Adding Repository variable in Bitbucket repository

After you have configured the BitBucket Pipeline file as shown in the previous blog, Click on Source control from the left sidebar.

Click on Source control

Generally Vs code automatically opens the repository available in the parent folder

If It does not open automatically, you will get a text like “A Git Repository found in the parent folder of the workspace or the open file” . Click on Open Repository.

Click on Open Repository
  • Click on bit bucket repo1.
  • Here you see all the changes in the repository
  • Enter any comment in the Message field. We are writing “Created lwc, apex with test class and yaml file configuration”.
  • Click on the drop-down on the right side of the commit button. Click on commit and push.
commit and push

It will push all the changes of bit bucket repo1 in the repository of Bitbucket. You can verify it by opening the bitbucket repository. It looks like below:

bitbucket repository

Open your Bitbucket repository left side menu and click on Repository settings. Scroll the left menu bar and click on the Repository variable.

Repository variable

Now, Add these value in Name and Value fields respectively andthe check secured check box for every value:

Name

  1. USERNAME_PROD
  2. USERNAME_UAT
  3. CONSUMER_KEY_UAT
  4. CONSUMER_KEY_PROD
  5. DECRYPTION_KEY_UAT
  6. DECRYPTION_KEY_PROD
  7. DECRYPTION_IV_PROD
  8. DECRYPTION_IV_UAT

 Value

  1. PROD username
  2. UAT Sandbox username
  3. UAT’s Consumer Key of ConnecTed app
  4. Production’s Consumer Key of Connected app
  5. Key generated to encrypt server.key for UAT
  6. Key generated to encrypt server.key for PROD
  7. Iv(initialization vector) generated to encrypt server.key for PRO
  8. Iv(initialization vector) generated to encrypt server.key for UAT

After adding all values it looks like below

All Repo Variaable

Validate and Deploy Apex and LWC from Dev to UAT:

  • We have created two Branches for UAT, sub_uat and main_uat.
  • If we want to validate changes in UAT then we should merge Dev Branch to sub_uat.
  • After successfully validating the changes in UAT, we will deploy those changes in UAT by merging the sub_uat branch into main_uat.

Validate changes in UAT:

  • Open your Bitbucket repo1 Repository.
  • Click on Pull request in the left side menu bar. Click on Create pull request.
  • For Source Branch choose Dev and for Destination Branch choose sub_uat
  • Enter Title Dev To sub_uat.

You can add a Description and also add a reviewer who will review your code or changes.

Bit bucket repo1 Repository

Click on Create Pull Request.

A new Pull Request is created because here we don’t have any reviewers so we have to approve and merge the code by clicking on Merge.

Create Pull Request

When Merge is completed pipeline will run automatically.

  • Click on Pipeline.
  • Click on Merged in Dev (pull request #1) Dev To sub_uat you can see it will do things one by one.
Click on Merged in Dev

After some time validation will be successful.

validation
  • Now log into the Uat environment and from Setup>Deployment status.
  • Click on Deployment status and in the Succeeded section you will see deployment with Validate: succeeded status.
succeeded status

Deploy the changes in UAT:

  • Open your Bit bucket repo1 Repository.
  • Click on Pull request in the left side menu baR. Click on Create pull request.
  • For Source Branch choose sub_uat and for Destination Branch choose main_uat.
  • Enter Title sub_uat To main_uat.

You can add a Description and also add a reviewer who will review your code or changes.

  • Click on Create Pull Request.
  • A new Pull Request is created because here we don’t have any reviewers so we have to approve and merge the code by clicking on Merge.

When Merge is completed pipeline will run automatically.

  • Click on Pipeline.
  • Click on Merged in Dev (pull request #2) sub_uat To main_uat you can see it will do things one by one.

After some time Deployment will be successful.

Deployment will be successful
  • Now log into Uat environment and from Setup>Deployment status.
  • Click on Deployment status and in Succeeded section you will see deployment with Deploy: succeeded status.
41 2

Now Apex class “firstApexClass” and its test class will be available in Uat. You can verify it from setup>Apex classes and there you will see your deployed apex classes.

deployed apex classes

For verify LWC from Setup>Custom Code>Lightning Components. And there you will find your deployed LWC.

deployed LWC

Finally, Validate and Deploy in the Production environment:

  • We have created two Branches for Production, sub_main and main.
  • If we want to validate changes in Production then we should merge main_uat Branch to sub_main.
  • After successfully validating the changes in Production to deploy changes in Production we will merge the sub_main branch into the main.

Validate changes in Production:

  • Open your Bit bucket repo1 Repository.
  • Click on Pull request in the left side menu bar. Click on Create pull request.
  • For Source Branch choose main_uat and for Destination Branch choose sub_main
  • Enter Title main_uat To sub_main.

You can add a Description and also add a reviewer who will review your code or changes.

  • A New Pull Request is created because here we don’t have any reviewers so we have to approve and merge the code by clicking on Merge.
  • When Merge is completed pipeline will run automatically. Click on Pipeline.
Validate changes in Production
  • Click on Merged in Dev (pull request #3) main_uat To sub_main you can see it will do things one by one.
  • After some time Validation will be successful.
After some time Validation will be successful
  • Now log into the Production environment and from Setup>Deployment status.
  • Click on Deployment status and in the Succeeded section you will see deployment with Validate: succeeded status.
41 3

Deploy changes in Production :

  • Open your Bit bucket repo1 Repository.
  • Click on Pull request in left side menu bar . Click on Create pull request.
  • For Source Branch choose sub_main and for Destination Branch choose main
  • Enter Title sub_main To main.
  • You can add Description and also add reviewer who will review your code or changes.
  • Click on Create Pull Request.
  • New Pull Request is created because here we don’t have any reviewer so we have to approve and merge the code by clicking on Merge.
  • When Merge is completed pipeline will run automatically. Click on Pipeline.
Click on Pipeline
  • Click on Merged in Dev (pull request #4) sub_main To main you can see it will do things one by one.
  • After some time Deployment will be successful.
  • Now log into the Production environment and from Setup>Deployment status.
  • Click on Deployment status and in the Succeeded section you will see deployment with Deploy: succeeded status.
  • Now Apex class “firstApexClass” and its test class will be available in Uat. You can verify it from setup>Apex classes and there you will see your deployed Apex classes.
verify it from setup>Apex classes

For verify LWC from Setup>Custom Code>Lightning Components. And there you will find your deployed LWC.

verify LWC

Conclusion:

Bitbucket is a powerful and flexible tool that can help you streamline your Salesforce development workflow and deliver better code faster. Compared to other version control tools such as GitLab or GitHub, Bitbucket offers more features and integrations for Salesforce developers, such as native support for Salesforce DX, Salesforce CLI, SFDX Scanner, and more.

Try out the solution in your org and feel free to contact us for any Salesforce Development solution!

No Data Found.

Related Articles
From SMBs to Enterprises: Why Salesforce CRM Remains the Choice for Every Business Size

Running a modern business requires a robust Salesforce CRM platform that connects teams, organizes customer data, and delivers real-time operational insights. In today’s competitive environment, waiting for information across disconnected systems is no longer practical, especially when modern buyers expect immediate responses across every channel. For years, the software was primarily associated with large corporate […]

Read More
How to Integrate NikoHealth to Salesforce

Healthcare organizations using NikoHealth often need patient, insurance, order, invoice, and prescription data available inside Salesforce. As data grows, manually updating records across systems becomes difficult and can lead to delays, duplicate work, and data inconsistencies. NikoHealth to Salesforce integration helps solve this challenge by automatically synchronizing data between both platforms. Instead of building custom […]

Read More
Flow Orchestrator vs. Traditional Flows: When to Use Each for Salesforce Automation

Businesses use Salesforce automation to reduce manual work, improve efficiency, and automate repetitive business processes. Two commonly used automation approaches inside Salesforce are Traditional Flows and Flow Orchestrator. Traditional Flows are mainly used for simple automation tasks such as updating records, sending notifications, creating tasks, and automating business logic. Flow Orchestrator is designed for more […]

Read More
The Rise of Agentic Government: How AI Agents Are Transforming Public Services

Government technology has often been seen as slower to evolve than the private sector. But Salesforce’s latest research challenges that idea in a big way. In fact, the new findings suggest that public sector organizations may now be moving faster than many businesses when it comes to adopting AI agents and preparing for a more […]

Read More
How To Use Email Service in APEX

Managing approvals, updates, and record changes directly from email can significantly improve efficiency within Salesforce workflows. Instead of logging in, navigating records, and manually updating fields, users can simply respond to emails and trigger automated updates using Email Service in APEX. This approach is especially useful for businesses leveraging Salesforce automation and looking to enhance […]

Read More
Design and Implementation of Salesforce-Jira Task Integration

Businesses have been using Salesforce for CRM operations and Jira for Agile project tracking. However, without integration, teams manually update both systems, leading to data inconsistency and inefficiency.This mechanism establishes a real-time integration between Salesforce and Jira, allowing seamless synchronization of tasks and agile board statuses.  A custom Salesforce dashboard was developed that replicates Jira-style […]

Read More
Our Location worldwide
Indian Flag India
7th Floor, A-10, Pegasus Tower, Sector 68, Noida, Uttar Pradesh 201301 +91-1203669505
United States of America Flag USA
333 West Brown Deer Road Unit G – 366 Milwaukee WI, USA 53217 +1(262) 310-7818
United Kingdom Flag UK
7 Bell Yard, London, WC2A 2JR +44 20 3239 9428
CA Flag Canada
HIC Global Solutions INC
6D - 7398 Yonge St #1124 Thornhill, ON L4J 8J2 Canada +1(262) 310-7818