1

I am trying to create a program that would display mandatory fields for a particular issue type for a project. So far I am able to display values for projects and issues using the JRJC. However I am not able to figure out how to display a default screen. Anybody face the same issue ?

Thanks

1
  • I guess its something to with getCreateMetaData but still cannot figure out how to use it Commented Jul 8, 2015 at 22:10

1 Answer 1

1

Thats right - you need to call the createmeta call with the project key, the issue type key and then expand the fields -

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

This will give you a list of fields and you can check if this field is required or not.

The JRJC equivalent is the getCreateMetaData call

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


        }
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.