Delete Jira Issue

Updated: Feb 8, 2023

This example shows you how to delete a Jira issue using DataPipeline.

Java Code Listing

package com.northconcepts.datapipeline.examples.jira;

import static org.junit.Assert.assertNotNull;

import com.northconcepts.datapipeline.core.Record;
import com.northconcepts.datapipeline.jira.JiraIssue;
import com.northconcepts.datapipeline.jira.client.JiraService;

public class DeleteJiraIssue {

    private static final String JIRA_DOMAIN = "JIRA_DOMAIN";
    private static final String JIRA_USERNAME = "USERNAME";
    private static final String JIRA_API_KEY = "API_KEY";
    public static void main(String[] args) {
        JiraService service = new JiraService(JIRA_DOMAIN, JIRA_USERNAME, JIRA_API_KEY);
        String key = createJiraIssueAndGetIssueKey(service);

    private static String createJiraIssueAndGetIssueKey(JiraService service) {
        JiraIssue jiraIssue = new JiraIssue()
            .setSummary("Create A Jira Issue")
            .setDescription("This is a story to understand how to create jira issue.")
            //.addCustomField("custom_field_01", "CustomValue") // Set custom fields if any


        Record response = service.createIssue(jiraIssue);
        assertNotNull(response.getFieldValueAsString("id", null));
        String key = response.getFieldValueAsString("key", null);
        return key;

Code Walkthrough

  1. JIRA_DOMAIN is your Jira domain e.g
  2. JIRA_USERNAME is your Jira username.
  3. JIRA_API_KEY is your Jira token which you can easily create in
  4. Create JiraService using above properties.
  5. Create JiraService.createIssue(JiraIssue jiraIssue) method is used to create issue in jira.
  6. Response is a record which has two parameters: id and key
  7. Delete a Jira issue using above key using JiraService.deleteIssue(String issueId) method.
Mobile Analytics