Issue with Retrieving Assignee for Jira Ticket Using API

DevOps iCapital March 26, 2024

Hello everyone,

I'm currently facing an issue with retrieving the assignee for a Jira ticket through the Jira API URL. Despite using the API endpoint "${JIRA_URL}/rest/api/2/issue/${ticket}?fields=assignee", all I'm receiving is Null. I'm uncertain about the correct solution to resolve this.

Any insights or guidance on how to troubleshoot and fix this issue would be greatly appreciated.

Thank you in advance for your assistance!

3 answers

0 votes
DevOps iCapital March 27, 2024

So the NUll is coming on the assignee I am getting all the other information 

0 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 26, 2024

Hello @DevOps iCapital 

Welcome to the Atlassian community.

The API is working for me.

Have you tried the API without the "fields" parameter to confirm that you can retrieve all data for the issue?

Have you confirmed that the issue exists, and has an Assignee value?

For the user identity used to authorize the request, does that user have access to the project and the specific issue you are trying to retrieve?

DevOps iCapital March 27, 2024

So the NUll is coming on the assignee I am getting all the other information 

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 27, 2024

Does the Assignee field for that specific issue actually have a person specified in it?

DevOps iCapital March 27, 2024

so the ticket has an assignee i can see the email and the person's name but assignee is blank/empty

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 27, 2024

In the results you got from extracting all the fields, can you check if there is more than one field named "assignee"?

DevOps iCapital March 27, 2024

so i run the following:

```local assignee=$(echo "$response" | jq -r '.fields.assignee.displayName')
echo "Jira Assignee: $assignee"
local COMMITTER_USERNAME=$(git log -1 --pretty=format:'%an')
echo "Committer: $COMMITTER_USERNAME"```
`
i am getting the correct name for assignee and committer however there is a bit of difference in the names which is causing the assignee and the committer usernames not to match and thats why i am getting an error 
0 votes
Laurie Sciutti
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.
March 26, 2024

Hi @DevOps iCapital and welcome to the Community!  Do you get the same result using api/3?

 

https://<yoursite>.atlassian.net/rest/api/3/issue/<key>?fields=assignee

Suggest an answer

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

Atlassian Community Events