Hi,
I'm using API to get all the open issues...
Is there a way to restrict the fields returned in response?
As of now, i'm getting all the fields in my response. I feel that's an over kill.
My sample code
private static async Task SearchJira(){try{string apiUrl = @"https://URL/rest/api/3/search?jql=project=ProjectName&maxResults=10";using (var httpClient = new HttpClient()){using (var request = new HttpRequestMessage(new HttpMethod("GET"), apiUrl)){var base64authorization =Convert.ToBase64String(Encoding.ASCII.GetBytes("emailId:AuthCode"));request.Headers.TryAddWithoutValidation("Authorization", $"Basic {base64authorization}");var response = await httpClient.SendAsync(request);var jsonString = await response.Content.ReadAsStringAsync();var jsonContent = JsonConvert.DeserializeObject<JiraResponse>(jsonString);}}}catch (Exception ex){throw ex;}}
Hi @S
Have you tried using the fields parameter:
https://docs.atlassian.com/software/jira/docs/api/REST/1000.824.0/#api/2/search
For example:
/rest/api/3/search?jql=project=myProject&fields=summary,key
Best regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.