You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.
Join groupJoin the community to find out what other Atlassian users are discussing, debating and creating.
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
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.