@ExperimentalApi public final class

IssueKey

extends Object
java.lang.Object
   ↳ com.atlassian.jira.issue.IssueKey

@ExperimentalApi

This class is considered usable by external developers but its contracts have not stabilized.

Experimental APIs may be changed at any time before being marked @Internal or @PublicApi.

Class Overview

Represents an Issue Key, allowing you to parse it into its Project key and Issue number components.

Summary

Nested Classes
class IssueKey.IsValidIssueKeyPredicate  
Public Constructors
IssueKey(String projectKey, long issueNumber)
IssueKey(Project project, long issueNumber)
Public Methods
static String format(String projectKey, long issueNumber)
static String format(Project project, long issueNumber)
static IssueKey from(String key)
Creates an IssueKey object form the given issue key String.
long getIssueNumber()
String getProjectKey()
static boolean isValidKey(String issueKey)
Returns true if the key is considered "valid"
String toString()
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public IssueKey (String projectKey, long issueNumber)

public IssueKey (Project project, long issueNumber)

Public Methods

public static String format (String projectKey, long issueNumber)

public static String format (Project project, long issueNumber)

public static IssueKey from (String key)

Creates an IssueKey object form the given issue key String.

This does some validation on the format of the given String. It must contain a dash ('-'), and the substring following the final dash must be a valid number. It validates that there is at least one character preceding the dash, but it does not validate that this is an existing key on this instance of JIRA.

Parameters
key The issue key as a string. eg "ABC_X20-1193"
Returns
  • the corresponding IssueKey object.
Throws
IllegalArgumentException if the given String is not a valid JIRA Issue key

public long getIssueNumber ()

public String getProjectKey ()

public static boolean isValidKey (String issueKey)

Returns true if the key is considered "valid"

Parameters
issueKey the key
Returns
  • true if the key is considered "valid"

public String toString ()