Close Menu
SalesforceCodex
    Facebook X (Twitter) Instagram
    Trending
    • How to Build a Generic Modal Window in Lightning Web Component
    • Top 10 Salesforce Flow Features of Salesforce Summer ’25
    • Unlock the Power of Vibe Coding in Salesforce
    • How to Implement Dynamic Queueable Chaining in Salesforce Apex
    • How to Implement Basic Queueable Chaining in Salesforce Apex
    • How to Suppress PMD Warnings in Salesforce Apex
    • Top 10 PMD Issues Salesforce Developers Should Focus on in Apex
    • How to Use Graph API for Outlook-Salesforce Connection
    Facebook X (Twitter) Instagram
    SalesforceCodex
    Subscribe
    Thursday, May 29
    • Home
    • Architecture
    • Salesforce
      • News
      • Apex
      • Integration
      • Books Testimonial
    • Questions
    • Certification
      • How to Prepare for Salesforce Integration Architect Exam
      • Certification Coupons
    • Integration Posts
    • Downloads
    • About Us
      • Privacy Policy
    SalesforceCodex
    Home»Salesforce»Apex»Create Jira Issue in Salesforce Apex with Jira Integration

    Create Jira Issue in Salesforce Apex with Jira Integration

    Dhanik Lal SahniBy Dhanik Lal SahniJanuary 4, 2024No Comments5 Mins Read
    Facebook Twitter Pinterest LinkedIn Tumblr Email
    Jir Integration in Salesforce
    Share
    Facebook Twitter LinkedIn Pinterest Email

    A Jira issue is a particular task, defect, or unit of work inside a Jira project. Jira issues are created by the user/team to log bug fixes, new features, improvements, or tasks. These are created directly in the Jira project. This post will give step-by-step information for Jira integration within Salesforce Apex and create a Jira issue from Salesforce.

    Jira is a popular project management tool.

    Use Case for Jira Integration in Apex

    Create a Jira issue from the Case record when the button ‘Create Jira Issue’ is clicked. Get the issue id after creation and put that in the Jira ID field.

    Solution

    To create a Jira issue in Salesforce, we will use the Jira REST API. We can integrate Jira REST API using Apex and Salesforce Flow. For this post, we will use Salesforce Apex to integrate Jira.

    We will create a Custom Metadata type for storing Jira information like project, issue type and due date. This information will be used to integrate and create issues in specific projects. We will also add one field JiraId in the Case object to update the generated Jira Id. This Jira id can be used later for retrieval for reporting purposes.

    Implementation

    To implement this we have to follow these steps

    1. Create Named and External Credential
    2. Create custom metadata type
    3. Create Apex Classes for Jira Integration
    4. Create an Apex Invocable class
    5. Create a flow to call the apex method from the Button
    6. Create a button to call Flow
    7. Test Functionality

    Let us handle each step to complete integration with Jira.

    1. Create Named and External Credential

    We will require a named credential for a secure connection between Salesforce and Jira. Follow steps 1 to 5 from the blog post, Verify API Connection in Flow HTTP Callout to create named credential, external credential, named principal, and permission set. Assign permission set to your user or required user. Assigning a permission set is mandatory for the user. If not assigned, the user can’t complete integration.

    For this post API URL is – https://salesforcecodex.atlassian.net/rest/api/3/issue/. It will be different for you, check it Jira project.

    2. Create custom metadata type

    Create a custom metadata type Jira Configuration (JiraConfig__mdt) to store Jira project information. Create below metadata fields

    Field LabelField APIData Type
    Due DateDueDate__cNumber(2, 0)
    Issue Type IdIssueTypeId__cText(20)
    Project KeyProjectKey__cText(20)
    Metadata Types Fields

    Add the below record in this metadata object.

    LabelJira Config NameDue DateProject KeyIssue Type Id
    PRJ1PRJ17SFDCTEAM10004

    If you have multiple projects, you can add all of them and use them in Apex accordingly. This information will be different for you, so add information accordingly.

    3. Create Apex Class for Jira Integration

    Create below apex classes for integrating Jira.

    1. BaseException – Common exception class.
    2. Jira – It is a data transformation class.
    3. JiraResponse – It is a callout response wrapper class.
    4. JiraService – This class holds code for the Jira API Integration.
    5. JiraTaskController – It is a controller class to call JiraService apex. It will get metadata information and current record information to use in Jira issue creation.

    Based on the above classes it will return the below JSON response which will be deserialzed using JiraResponse class.

    {
        "id": "10005",
        "key": "SFDCTEAM-6",
        "self": "https://salesforcecodex.atlassian.net/rest/api/3/issue/10005"
    }

    4. Create an Apex Invocable class

    As we need to create the Jira Issue on the button click, we have to call the above classes from the button. We can not call the apex class directly from the button, we need to call this class from the Lightning component or Screen flow. We will use screen flow for this purpose.

    To use the apex class in flow, we need to create an invocable apex class. Create the below apex that will be called from the screen flow. Method createIssue will call JiraTaskController to create an issue based on the passed parameter from the flow.

    5. Create a Screen Flow to Invocable Method

    Create a screen flow Jira Issue Creation and add action on it. On action select above created Invocable Method Create Jira Issue. This action requires a current record id for method execution so create a text variable with the API name recordId. The variable should be marked checked for Available for input.

    Jira Integration | Flow Action | SalesforceCodex
    Create Flow Action Element

    6. Create an action button on the object

    Create an action button to create Jira issue on the case object. This button will call the above-created screen flow.

    LabelCreate Jira Issue
    Action TypeFlow
    FlowJira Issue Creation
    Standard Label Type–None–
    NameCreate_Jira_Issue
    Jira Integration | Create Action Button | SalesforceCodex
    Create an Action Button on the Salesforce Object

    7. Add a Button to the Page Layout

    Add the above-created action button to the page layout. This button will call flow to execute API Integration.

    Jira Integration | Add Button to Page Layout | SalesforceCodex
    Add Button to Salesforce Page Layout

    8. Test Jira Integration

    Check this video for a demo of Jira Integration.

    References

    The Jira Cloud platform REST API

    Verify API Connection in Flow HTTP Callout

    Similar Posts

    Accessing External Credential Parameters of Named Credential in Salesforce Apex

    Configurable Record Picker in Lightning Web Component

    Displaying Tabular Data with GraphQL in Lightning Web Component

    Dynamically Instantiate Components in LWC

    Seamless YouTube Video API Integration in Salesforce

    GraphQL Query Generator in Salesforce Apex

    Capture Images in Salesforce using Mobile App

    Need Help?

    Need some kind of help in implementing this feature, connect on my LinkedIn profile Dhanik Lal Sahni.

    action button apex flow integration invocable class invocable method jira jira in apex jira integration jira issue page layout rest api salesforce salesforce apex screen flow
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleAccessing External Credential Parameters of Named Credential in Salesforce Apex
    Next Article Ultimate Guide to Monitoring Platform Events using Streaming Monitor
    Dhanik Lal Sahni
    • Website
    • Facebook
    • X (Twitter)

    With over 18 years of experience in web-based application development, I specialize in Salesforce technology and its ecosystem. My journey has equipped me with expertise in a diverse range of technologies including .NET, .NET Core, MS Dynamics CRM, Azure, Oracle, and SQL Server. I am dedicated to staying at the forefront of technological advancements and continuously researching new developments in the Salesforce realm. My focus remains on leveraging technology to create innovative solutions that drive business success.

    Related Posts

    By Dhanik Lal Sahni4 Mins Read

    How to Build a Generic Modal Window in Lightning Web Component

    May 26, 2025
    By Dhanik Lal Sahni6 Mins Read

    Top 10 Salesforce Flow Features of Salesforce Summer ’25

    May 11, 2025
    By Dhanik Lal Sahni6 Mins Read

    Unlock the Power of Vibe Coding in Salesforce

    April 30, 2025
    Add A Comment
    Leave A Reply Cancel Reply

    Ranked #1 SALESFORCE DEVELOPER BLOG BY SALESFORCEBEN.COM
    Featured on Top Salesforce Developer Blog By ApexHours
    Recent Posts
    • How to Build a Generic Modal Window in Lightning Web Component
    • Top 10 Salesforce Flow Features of Salesforce Summer ’25
    • Unlock the Power of Vibe Coding in Salesforce
    • How to Implement Dynamic Queueable Chaining in Salesforce Apex
    • How to Implement Basic Queueable Chaining in Salesforce Apex
    Ranked in Top Salesforce Blog by feedspot.com
    RSS Recent Stories
    • How to Connect Excel to Salesforce to Manage Your Data and Metadata February 9, 2025
    • Difference Between With Security and Without Security in Apex January 2, 2025
    • Top Reasons to Love Salesforce Trailhead: A Comprehensive Guide December 5, 2024
    • How to Utilize Apex Properties in Salesforce November 3, 2024
    • How to Choose Between SOQL and SOSL Queries July 31, 2024
    Archives
    Categories
    Tags
    apex (111) apex code best practice (8) apex rest (11) apex trigger best practices (4) architecture (22) Asynchronous apex (9) AWS (5) batch apex (9) batch processing (4) code optimization (8) code review tools (3) custom metadata types (5) design principle (9) file upload (3) flow (15) future method (4) google (6) google api (4) integration (19) integration architecture (6) lighting (8) lightning (64) lightning-combobox (5) lightning-datatable (10) lightning component (30) Lightning web component (62) lwc (51) named credential (8) news (4) optimize apex code (4) Permission set (4) pmd (3) Queueable (9) rest api (23) S3 Server (4) salesforce (141) salesforce apex (46) salesforce api (4) salesforce api integration (5) Salesforce Interview Question (4) salesforce news (5) salesforce question (5) solid (6) tooling api (5) Winter 20 (8)

    Get our newsletter

    Want the latest from our blog straight to your inbox? Chucks us your detail and get mail when new post is published.
    * indicates required

    Ranked #1 SALESFORCE DEVELOPER BLOG BY SALESFORCEBEN.COM
    Featured on Top Salesforce Developer Blog By ApexHours
    Recent Posts
    • How to Build a Generic Modal Window in Lightning Web Component
    • Top 10 Salesforce Flow Features of Salesforce Summer ’25
    • Unlock the Power of Vibe Coding in Salesforce
    • How to Implement Dynamic Queueable Chaining in Salesforce Apex
    • How to Implement Basic Queueable Chaining in Salesforce Apex
    Ranked in Top Salesforce Blog by feedspot.com
    RSS Recent Stories
    • How to Connect Excel to Salesforce to Manage Your Data and Metadata February 9, 2025
    • Difference Between With Security and Without Security in Apex January 2, 2025
    • Top Reasons to Love Salesforce Trailhead: A Comprehensive Guide December 5, 2024
    • How to Utilize Apex Properties in Salesforce November 3, 2024
    • How to Choose Between SOQL and SOSL Queries July 31, 2024
    Archives
    Categories
    Tags
    apex (111) apex code best practice (8) apex rest (11) apex trigger best practices (4) architecture (22) Asynchronous apex (9) AWS (5) batch apex (9) batch processing (4) code optimization (8) code review tools (3) custom metadata types (5) design principle (9) file upload (3) flow (15) future method (4) google (6) google api (4) integration (19) integration architecture (6) lighting (8) lightning (64) lightning-combobox (5) lightning-datatable (10) lightning component (30) Lightning web component (62) lwc (51) named credential (8) news (4) optimize apex code (4) Permission set (4) pmd (3) Queueable (9) rest api (23) S3 Server (4) salesforce (141) salesforce apex (46) salesforce api (4) salesforce api integration (5) Salesforce Interview Question (4) salesforce news (5) salesforce question (5) solid (6) tooling api (5) Winter 20 (8)

    Get our newsletter

    Want the latest from our blog straight to your inbox? Chucks us your detail and get mail when new post is published.
    * indicates required

    Facebook X (Twitter) Instagram Pinterest YouTube Tumblr LinkedIn Reddit Telegram
    © 2025 SalesforceCodex.com. Designed by Vagmine Cloud Solution.

    Type above and press Enter to search. Press Esc to cancel.

    Ad Blocker Enabled!
    Ad Blocker Enabled!
    Our website is made possible by displaying online advertisements to our visitors. Please support us by disabling your Ad Blocker.