Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
Level
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

rest/api/3/issue Get selected fields only

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

  1. private static async Task SearchJira()
  2. {
  3. try
  4. {
  5. string apiUrl = @"https://URL/rest/api/3/search?jql=project=ProjectName&maxResults=10";
  6. using (var httpClient = new HttpClient())
  7. {
  8. using (var request = new HttpRequestMessage(new HttpMethod("GET"), apiUrl))
  9. {
  10. var base64authorization =
  11. Convert.ToBase64String(Encoding.ASCII.GetBytes("emailId:AuthCode"));
  12. request.Headers.TryAddWithoutValidation("Authorization", $"Basic {base64authorization}");
  13. var response = await httpClient.SendAsync(request);
  14. var jsonString = await response.Content.ReadAsStringAsync();
  15. var jsonContent = JsonConvert.DeserializeObject<JiraResponse>(jsonString);
  16. }
  17. }
  18. }
  19. catch (Exception ex)
  20. {
  21. throw ex;
  22. }
  23. }

 

 

1 answer

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

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you