检索表单以在 JIRA Rest Java 客户端中创建问题
Retrieving form to create issue in JIRA Rest Java Client
我正在尝试创建一个程序来显示项目特定问题类型的必填字段。到目前为止,我能够使用 JRJC 显示项目和问题的值。但是我无法弄清楚如何显示默认屏幕。有人遇到同样的问题吗?
谢谢
没错 - 您需要使用项目密钥、问题类型密钥调用 createmeta 调用,然后展开字段 -
curl -D- -u fred:fred -X GET -H "Content-Type: application/json" http://kelpie9:8081/rest/api/2/issue/createmeta?projectKeys=QA&issuetypeNames=Bug&expand=projects.issuetypes.fields
这将为您提供一个字段列表,您可以检查是否需要此字段。
JRJC 等价于 getCreateMetaData 调用
GetCreateIssueMetadataOptions options = new GetCreateIssueMetadataOptionsBuilder()
.withExpandedIssueTypesFields()
.withProjectKeys("CGIM")
.build();
List myList=(List) restClient.getIssueClient().getCreateIssueMetadata(options, pm); // getting the issue creation metadata relatively to the project im searching for
java.util.Iterator<CimProject> it1=myList.iterator();
while(it1.hasNext())
{
CimProject c=it1.next();
List issueT=(List) c.getIssueTypes(); // getting the list of issue types linked to this project
java.util.Iterator<CimIssueType> it2=issueT.iterator();
while (it2.hasNext())
{
CimIssueType issueType=it2.next();
System.out.print(issueType.getName());
Map<String, CimFieldInfo> fieldList=issueType.getFields(); // getting the list of fields linked to each issue type
for(Entry<String, CimFieldInfo> entry : fieldList.entrySet()) {
String cle = entry.getKey();
CimFieldInfo valeur = entry.getValue();
System.out.println(valeur.getName());
}
}
}
我正在尝试创建一个程序来显示项目特定问题类型的必填字段。到目前为止,我能够使用 JRJC 显示项目和问题的值。但是我无法弄清楚如何显示默认屏幕。有人遇到同样的问题吗?
谢谢
没错 - 您需要使用项目密钥、问题类型密钥调用 createmeta 调用,然后展开字段 -
curl -D- -u fred:fred -X GET -H "Content-Type: application/json" http://kelpie9:8081/rest/api/2/issue/createmeta?projectKeys=QA&issuetypeNames=Bug&expand=projects.issuetypes.fields
这将为您提供一个字段列表,您可以检查是否需要此字段。
JRJC 等价于 getCreateMetaData 调用
GetCreateIssueMetadataOptions options = new GetCreateIssueMetadataOptionsBuilder()
.withExpandedIssueTypesFields()
.withProjectKeys("CGIM")
.build();
List myList=(List) restClient.getIssueClient().getCreateIssueMetadata(options, pm); // getting the issue creation metadata relatively to the project im searching for
java.util.Iterator<CimProject> it1=myList.iterator();
while(it1.hasNext())
{
CimProject c=it1.next();
List issueT=(List) c.getIssueTypes(); // getting the list of issue types linked to this project
java.util.Iterator<CimIssueType> it2=issueT.iterator();
while (it2.hasNext())
{
CimIssueType issueType=it2.next();
System.out.print(issueType.getName());
Map<String, CimFieldInfo> fieldList=issueType.getFields(); // getting the list of fields linked to each issue type
for(Entry<String, CimFieldInfo> entry : fieldList.entrySet()) {
String cle = entry.getKey();
CimFieldInfo valeur = entry.getValue();
System.out.println(valeur.getName());
}
}
}