"reporter": {"id": "712020:50163ca5-c07e-4a15-a400-14aa37f48cee"}, "priority": {"name": "Medium"} }} 2024-07-11 12:34:02 - Failed to create ticket. Status: 500. Response: {"message":"Cannot invoke \"com.atlassian.jira.user.ApplicationUser.getUsername()\" because \"user\" is null","status-code":500,"stack-trace":""}
Hi @Rakesh
What API are you trying to call? And is this the complete Json body that you're passing?
From the looks of it I'd recommend checking if the user has permissions to create a ticket or can be set as the reporter, would also check if the user who is setting the User Assignee (user whose token is used) has the Assign Issue permission too
I am using this url to fetch the user details.
url: "https://example.atlassian.net/rest/api/3/user/search?query=example@gmail.com".
The user is there in the project and have the permissions that you have mentioned.
And about json, for now i hard coded the accountId for the reporter field.But i am getting this error:{"message":"Cannot invoke \"com.atlassian.jira.user.ApplicationUser.getUsername()\" because \"user\" is null","status-code":500,"stack-trace":""}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Rakesh
Thanks for the info, can you mention for which API you get the 500 error? Or What's the steps that you've used to reproduce this error.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am using this url for fetching the user details,
https://example.atlassian.net/rest/api/3/user/search?query=example@gmail.com
But i am getting the empty response, like i am not getting data of that user in jsonarray.
And also can you specify the value that i need to pass for reporter?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Rakesh
For the User search api, your api is correct. Does your User have access to the user administration though, since without that permission it may not be feasible to get an results.
About the fields.put() don't have much insights into that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Actually I am the project Admin and i am trying to give my accountId as value for reporter field.And i am doing that by using the code. I will tell the process,
First i need to fetch the user details by using the gmail.
second i will fetch the accountId from that details and pass it as value for the reporter field.
How can i check this "Does your User have access to the user administration though"? and
is accountId should be passed for reporter field right?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use Control + K on your keyboard and search for 'Global Permissions', if you have access to this that means you have Jira Admin access.
Check for the "Browse users and group", this permission needs to be available for the users to be searchable.
After this to verify your access, click on the cog icon and see the options listed there, if you see Administration settings and the User Administration settings, then u have site administration access (feel free to share the image here if you require assistance for this)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.