简体   繁体   English

java.lang.UnsupportedOperationException:option不是受支持的字段类型

[英]java.lang.UnsupportedOperationException: option is not a supported field type

Using the following library 使用以下库

<dependency>
    <groupId>net.rcarz</groupId>
    <artifactId>jira-client</artifactId>
    <version>0.5</version>
</dependency> 

I am getting error while executing below code: 我执行下面的代码时遇到错误:

BasicCredentials creds = new BasicCredentials("username", "password");
JiraClient jira = new JiraClient("xyz/rest/api/2/issue", creds);

Issue newIssue = jira.createIssue("XYZ", "Bug")
           .field(Field.SUMMARY, "tEST bUG")
           .field("customfield_20200","No STeps")
           .field("customfield_20202","No actual")
           .field("customfield_25600",Field.valueById("35650"))
            .execute();

Getting error for field("customfield_25600",Field.valueByID("35650")) 获取field("customfield_25600",Field.valueByID("35650"))错误field("customfield_25600",Field.valueByID("35650"))

Error Description : 错误描述:

java.lang.UnsupportedOperationException: option is not a supported field type java.lang.UnsupportedOperationException:option不是受支持的字段类型

This is customized field in JIRA. 这是JIRA中的定制领域。

Please let me know if required more information. 如果需要更多信息,请告诉我。

Thanks in advance. 提前致谢。

Seems to be a known issue with the library,the field you try to add is probably an option and it is not supported 似乎是库的已知问题,您尝试添加的字段可能是一个option并且不受支持

The error was already reported here: 这里已经报告了错误:

https://github.com/rcarz/jira-client/issues/123 https://github.com/rcarz/jira-client/issues/123

Hi, 嗨,

trying to use custom fields, I encounter the following issue : For a "Select List (single choice)" type of field, I get the following exception when trying to create an issue : Exception: java.lang.UnsupportedOperationException: option is not a supported field type at net.rcarz.jiraclient.Field.toJson(Field.java:655) at net.rcarz.jiraclient.Issue$FluentCreate.executeCreate(Issue.java:104) at net.rcarz.jiraclient.Issue$FluentCreate.execute(Issue.java:59) 尝试使用自定义字段时,我遇到以下问题:对于“选择列表(单选)”类型的字段,我在尝试创建问题时遇到以下异常:异常:java.lang.UnsupportedOperationException:option不是支持字段类型net.rcarz.jiraclient.Field.toJson(Field.java:655)net.rcarz.jiraclient.Issue $ FluentCreate.executeCreate(Issue.java:104)at net.rcarz.jiraclient.Issue $ FluentCreate。执行(Issue.java:59)

I'm using JIRA v7.1.0-OD-05-006 我正在使用JIRA v7.1.0-OD-05-006

It seems to have to do with the JIRA version. 这似乎与JIRA版本有关。

Following the link to #154, it seems that it was not fixed. 在链接到#154之后,它似乎没有修复。

https://github.com/rcarz/jira-client/pull/154 https://github.com/rcarz/jira-client/pull/154

The issue still persists 这个问题仍然存在

Caused by: java.lang.UnsupportedOperationException: option is not a supported field type at net.rcarz.jiraclient.Field.toJson(Field.java:737) at net.rcarz.jiraclient.Issue$FluentCreate.executeCreate(Issue.java:102) at net.rcarz.jiraclient.Issue$FluentCreate.execute(Issue.java:57) 引起:java.lang.UnsupportedOperationException:选项不是net.rcarz.ji上的net.rcarz.jiraclient.Field.toJson(Field.java:737)支持的字段类型.Issue $ FluentCreate.executeCreate(Issue.java: 102)at net.rcarz.jiraclient.Issue $ FluentCreate.execute(Issue.java:57)

Here is my snippet code looks like. 这是我的代码段代码。 The customfield_12133 is an options. customfield_12133是一个选项。

JiraClient jiraClient; JiraClient jiraClient; Issue issue = jiraClient.createIssue("MYPROJECT", "Internal Bug") .field(Field.SUMMARY, summary) .field(Field.DESCRIPTION, summary) .field("customfield_12133", "Other") .execute(); 问题= jiraClient.createIssue(“MYPROJECT”,“内部错误”).field(Field.SUMMARY,摘要).field(Field.DESCRIPTION,summary).field(“customfield_12133”,“Other”)。execute();

Finally pull #176 should actually have fixed it: 最后拉#176应该已经修好了:

https://github.com/rcarz/jira-client/pull/176 https://github.com/rcarz/jira-client/pull/176

might be fixed in the next version (0.6) of the library 可能会在库的下一个版本(0.6)中修复

Field#toJson() method had not know about option type in v0.5, it was added later. Field#toJson()方法在v0.5中不知道选项类型,后来又添加了。 That is why method throws UnsupportedOperationException . 这就是方法抛出UnsupportedOperationException Try to use the latest version from GitHub: https://github.com/rcarz/jira-client 尝试使用GitHub的最新版本: https//github.com/rcarz/jira-client

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 DBFit java.lang.UnsupportedOperationException: 不支持类型 İNT - DBFit java.lang.UnsupportedOperationException: Type İNT is not supported “ java.lang.UnsupportedOperationException:尚不支持。” - “java.lang.UnsupportedOperationException: Not supported yet.” “java.lang.UnsupportedOperationException:尚不支持。” - “java.lang.UnsupportedOperationException: Not supported yet.” java.lang.UnsupportedOperationException:尚不支持 - java.lang.UnsupportedOperationException: Not supported yet Java Dropbox HttpServletRequest(java.lang.UnsupportedOperationException:尚不支持。) - Java Dropbox HttpServletRequest ( java.lang.UnsupportedOperationException: Not supported yet.) 由java.lang.UnsupportedOperationException引起:AdapterView不支持addView(View,layoutParams) - Caused by java.lang.UnsupportedOperationException: addView(View,layoutParams) is not supported in the AdapterView Duke Fast Deduplication:java.lang.UnsupportedOperationException:尚不支持操作? - Duke Fast Deduplication: java.lang.UnsupportedOperationException: Operation not yet supported? Tomcat连接池-java.lang.UnsupportedOperationException:BasicDataSource不支持 - Tomcat Connection Pooling - java.lang.UnsupportedOperationException: Not supported by BasicDataSource java.lang.UnsupportedOperationException: &#39;posix:permissions&#39; 不支持作为 Windows 上的初始属性 - java.lang.UnsupportedOperationException: 'posix:permissions' not supported as initial attribute on Windows java.lang.UnsupportedOperationException: DROP CONSTRAINT 仅支持 Hibernate - java.lang.UnsupportedOperationException: DROP CONSTRAINT is only supported for Hibernate
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM