jira-client
jira-client copied to clipboard
Transition was not found in metadata
This is the error I get when I try to set assignee or change resolution.Basically when i use transition it doesn't work. Pls help me out.Thanks in advance.This is the code.
public class jiratest {
public static void main(String[] args) {
BasicCredentials creds = new BasicCredentials("***", "****");
JiraClient jira = new JiraClient("https://myportal.reflexisinc.com/JIRA", creds);
try {
/* Retrieve issue TEST-123 from JIRA. We'll get an exception if this fails. */
final Issue issue = jira.getIssue("IM-2");
/* Print the issue key. */
System.out.println(issue);
/* Open the issue and assign it to batman. */
issue.transition()
.field(Field.ASSIGNEE, "xyz")
.execute("Open");
/* Assign the issue */
issue.update()
.field(Field.ASSIGNEE, "xyz")
.execute();
} catch (JiraException ex) {
System.err.println(ex.getMessage());
if (ex.getCause() != null)
System.err.println(ex.getCause().getMessage());
}
}
}
Perhaps related to #160
That usually means the state name (Open, in this case) supplied in execute either doesn't exist or is not available from the current state of the issue.
OK, sir @rcarz , the problem is solved already... BTW, your code is perfect, very cool.