Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How do I get assignee using the Atlassian API?

Jack Kower April 4, 2024

Hi all! I am new to using the Atlassian API. What I want to get back is the person who is assigned to a ticket. I got the GET request working and am able to retrieve all the Service Management data and can select fields like project, description, and summary. When I looked at the API docs, it seemed like the assignee was called displayName in the json object. How do I get back either assignee or person who created the issue?

For context, I'm using Python to interact with the API.

2 answers

2 votes
Kalyan Sattaluri
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 4, 2024

Hello @Jack Kower 

Am not sure what are you asking. Are you using below end point?

/rest/api/2/issue/{issueIdOrKey}

https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-issueidorkey-get

Assignee object has different fields available, displayName, email, accountID for example.

Same with created object.

image.png

Jack Kower April 4, 2024

I'm using the url 

https://<name_of_org>.atlassian.net/rest/api/3/search.
This is what I get when I do a general request. I want the assignee only.
image.pngSo yes, same json object. 
I was able to do a GET on just project with this snippet
'project': fields.get('project', {}).get('key'),
I am wondering how I would achieve this same result. I tried 
'assignee': fields.get('displayName', {}).get('displayName', ''), but it returned an empty string, even though I know I can get back multiple objects. Do you know how I can change that code?
 
0 votes
Kalyan Sattaluri
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 4, 2024

Hello @Jack Kower 

I am not a developer and need to wait for others to pitch in, but if 

'project'fields.get('project', {}).get('key'),     gave you the project key, doesnt below give you display name?

'assignee'fields.get('assignee', {}).get('displayName'),

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
AUG Leaders

Atlassian Community Events