com.atlassian.jira.issue
Class IssueKey

java.lang.Object
  extended by com.atlassian.jira.issue.IssueKey

@ExperimentalApi
public final class IssueKey
extends Object

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


Nested Class Summary
static class IssueKey.IsValidIssueKeyPredicate
           
 
Constructor Summary
IssueKey(Project project, long issueNumber)
           
IssueKey(String projectKey, long issueNumber)
           
 
Method Summary
static String format(Project project, long issueNumber)
           
static String format(String projectKey, 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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IssueKey

public IssueKey(String projectKey,
                long issueNumber)

IssueKey

public IssueKey(Project project,
                long issueNumber)
Method Detail

getProjectKey

public String getProjectKey()

getIssueNumber

public long getIssueNumber()

toString

public String toString()
Overrides:
toString in class Object

from

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

format

public static String format(Project project,
                            long issueNumber)

format

public static String format(String projectKey,
                            long issueNumber)

isValidKey

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"


Copyright © 2002-2014 Atlassian. All Rights Reserved.