Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

I getting error "Exception in thread "main" java.lang.UnsupportedOperationException: option is not "

Shashikant Wadikar
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 14, 2019

I am getting error while using JIRA REST API in java to create defect with selecting option for customized field.

 

Below is the code:

public class createDefect {

public static void main(String[] args) throws JiraException, IOException {

BasicCredentials creds = new BasicCredentials("username", "pwd");

JiraClient jira;
jira = new JiraClient("url", creds);

System.out.println(jira.getIssueTypes());

Issue newIssue = jira.createIssue("DI", "Bug")//.field("customfield_26000",Field.valueByKey("36250"))
.field(Field.SUMMARY, "tEST bUG")
.field("customfield_20200","No STeps")
.field("customfield_20202","No actual")
.field("customfield_26000",new ArrayList() {{add(Field.valueByKey("36250"));}}) // .field("customfield_26000",Field.valueByValue("")) Field.valueById(""); //here we are getting error
.execute();

}

}

 

Error Snap:

Exception in thread "main" java.lang.UnsupportedOperationException: option is not a supported field type
at net.rcarz.jiraclient.Field.toJson(Field.java:616)
at net.rcarz.jiraclient.Issue$FluentCreate.executeCreate(Issue.java:104)
at net.rcarz.jiraclient.Issue$FluentCreate.execute(Issue.java:59)
at PKG.createDefect.main(createDefect.java:37)

 

Currently using JIRA CLIENT 0.5

0 answers

Suggest an answer

Log in or Sign up to answer