jira-client icon indicating copy to clipboard operation
jira-client copied to clipboard

Transition was not found in metadata

Open agastyanarumanchi opened this issue 9 years ago • 2 comments

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());
    }
}

}

agastyanarumanchi avatar Apr 20 '16 06:04 agastyanarumanchi

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.

bobcarroll avatar May 30 '16 18:05 bobcarroll

OK, sir @rcarz , the problem is solved already... BTW, your code is perfect, very cool.

2540461056 avatar Oct 08 '22 12:10 2540461056