Hello,
Im curently using JIRA Java Rest CLient and i want to get all fields present in a screen ( linked to a screen scheme for example) . So to be clear, i have a screen named "myScreen" which contains fields and i want to get those fields using JIRA Java Rest Client.
Thanks in advance,
Hamza
Hello guys. I eventually found out the answer. I'm using , in fact, Jira Java Rest Client and i retrieve now all the fields linked to an issue type using the code below:
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()); } } }
Hope i could help someone who's searching for the same thing and thank you all for your help.
Hi Hamza,
I guess you can try to use REST API below to get the available fields:
/rest/api/2/screens/{screenId}/availableFields
https://docs.atlassian.com/jira/REST/latest/#id102121
Hope its helps.
Thanks, John
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi John, thanks for your answer. can you just tell me how to use such querie in a java project for example?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The method is what John suggested. The above post only says how you can use Jersey to access methods from Java. You need to combine both.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No it actually didn't help. currently i can access issues usig jira java rest client. But my purpose is to have the list of the fields present in a screen that i did define. Im still strugling to find a method to do so.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am looking exactly for such a code. I tried using above snippet but didnt work. any suggestions?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.