Hi ,I am pulling issue data from Jira using REST-APi. But not able to see assignee field.

Payal Patel February 2, 2020

Hi ,I am pulling issue data from Jira using REST-APi. But not able to see assignee field.I get below fields from API call

SUMMARY

IssueType

Created

Duredate

CustomField_Time created

Reporter

Status

this list is  missing Assignee detail.Is it related to level of access i have?

 

 

3 answers

1 vote
DPKJ
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 2, 2020

@Payal Patel  Welcome to the community!

Looking at conversation with @carlosughini , it seems you are using Service Desk Rest API, and not Jira Cloud Rest API.

As per documentation of API you are using,

This method returns the customer requests in a queue. Only fields that the queue is configured to show are returned. For example, if a queue is configured to show description and due date, then only those two fields are returned for each customer request in the queue.

So, if you have configured 'assignee' field to be visible, it will be returned as API response otherwise not.

Now, you couple of options here,

  1. Configure 'assignee' field as visible field, or
  2. Use Jira Cloud's rest API
    • As suggested by @carlosughini this will look like this,
    • BASE_URL/rest/api/3/<ISSUE_KEY>

 

Hopefully this resolves your issue.

Payal Patel February 2, 2020

Thanks..I get access forbidden error with Cloud API.. Where as Servicedesk api works fine but missing field. Which call is good Cloud API or service desk? I am creating connection in power bi ..

DPKJ
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 2, 2020

@Payal PatelJira Cloud API is for sure more powerful and easy to use (you will find lots of resources build around that).

If you are getting 'access forbidden' error do check with your Administrator that if you have access to Jira Cloud, otherwise only way to 'assignee' for you is by making that field visible.

Payal Patel February 2, 2020

@DPKJ  can you please tell me how to check if I have access or not .Can I check from web browser?  I can login to Jira  using https://host/jira/servicedesk/projects/Projectkey/queues/

and see all queue.Sorry to ask simple questions but I am new to Jira Api's .

DPKJ
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 2, 2020

You can simply login to "Jira" and visit page like, BASE_URL/browse/ISSUE_KEY

If you can access this page, try BASE_URL/rest/api/3/issue/ISSUE_KEY (in same browser to validate rest)

If both of these work fine, you have access, and you might be making some mistake in API call.

Payal Patel February 2, 2020

@DPKJ One good news.. I am able to pull issues by passing issue key but I have to pull all issue information .Cant pass individual issue key.Any suggestion or documentation link will be great help.

Payal Patel February 2, 2020

I read some where to provide maxResult count with startat index..but this is manual step. every time i have to refresh report i have to update this parameters to get new issues.Is there any way to get all issues in one go?

DPKJ
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 2, 2020

@Payal Patel

To fetch multiple issue as a time you need to use issue search API.

Documented here - https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-search-get

here if you don't provide anything in search it will return all issues, and if you want to limit issues to specific project you can provide jql param like this "project='PROJECT_KEY'"

And as this is paginated API, you will need to provide page data, defined by params, startAt and maxResults. (there is no API to get all data without pagination).

Payal Patel February 4, 2020

I am doing below API Call and it is not returning me only Open Issues..And returns me all issues short by date.

Can you tell me whts wrong in this URL

https://HostAddress/rest/api/3/search?jql=project=ICT&Currentstatus=Open&maxresults=100%20ORDER%20BY%20created%20DESC

DPKJ
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 4, 2020

Something like this will work for you,

BASE_URL/rest/api/3/search?maxResults=10&startAt=0&jql=project%3DICT%20AND%20status%3DOpen%20order%20by%20created%20DESC
1 vote
carlosughini
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 2, 2020

Hello Payal,

Are you able to see the assignee directly on Jira? Additionally, which endpoint are you using to retrieve the information? 

By querying for a particular issue you should receive the assignee, for example:

http://hostname/rest/api/latest/ISSUEKEY

You would receive a JSON response like this:

    "assignee": {
          "self": "http://hostname/rest/api/latest/user?username=abcd",
          "name": "abcd",
          "emailAddress": "mail@abc.com",
          "avatarUrls": {....}
}

 Looking forward to hearing from you.

Cheers,

Carlos

Payal Patel February 2, 2020

I am using this api call to get issue information.

https://Hostname/rest/servicedeskapi/servicedesk/1/queue/1/issue

out put of this call is field I mentioned earlier.I was looking for assignee key in it.

I need to get all queue for my reporting purpose

0 votes
morteza najafian October 10, 2022

hi

this is example of get issues from rest api 

`${jiraBaseUrl}/rest/api/2/search?jql=project="${params.project}" AND status="${params.status}"&fields=*all,-project,-issuelinks,-worklog,-watcher&${query}`,

 by adding -before field name you get fields except those

Suggest an answer

Log in or Sign up to answer