Look Up Jira Transition IDs
Updated: Feb 1, 2023
This example shows you how to get transition IDs (for "To Do", "In Progress", "Done", etc.) for a Jira issue using DataPipeline.
Once you have the list of IDs, you can transition an issue by following the Transition Jira Issue example.
Java Code Listing
package com.northconcepts.datapipeline.examples.jira; import com.northconcepts.datapipeline.core.Record; import com.northconcepts.datapipeline.jira.client.JiraService; public class LookUpJiraTransitionIds { 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); Record record = service.getIssueTransitions("AB-12"); System.out.println(record); } }
Code Walkthrough
JIRA_DOMAIN
is your Jira domain e.ghttps://company.atlassian.net
.JIRA_USERNAME
is your Jira username.JIRA_API_KEY
is your Jira token which you can easily create in https://id.atlassian.com/manage/api-tokens.- Create JiraService using above properties.
- JiraService.getIssueTransitions(String issueId) method is used to fetch all the transition IDs for a given issue ID. This method returns a record with all the transition IDs.
- Print this record containing all the transition IDs.
Sample Console Output
Record (MODIFIED) { 0:[11]:STRING=[To Do]:String 1:[21]:STRING=[In Progress]:String 2:[31]:STRING=[Done]:String }