I have a Forge UI Kit 2 UserPicker that works for me in my dev site but doesn’t populate on my friend’s site. What we see on his site is that clicking it shows its loading spinner for a fraction of a second, then the spinner disappears but no users are shown.
On his site I notice that every time I click it a HTTP 403 appears in the JS console for POST https://cuffeco.atlassian.net/gateway/api/v1/recommendations. This does not happen on my dev site.
The UserPicker is very simple:
<UserPicker
label="Whose tasks would you like to view?"
name='user'
/>
The app already had the read:jira-work permission and I added read:jira-user but that didn’t change the result.
Am I doing something wrong here, or is this a bug? What can I do to get the UserPicker working?
Which extension point is this app installed in? Also you may need to reconfigure the project permissions on your friend’s site - see this page about permissions - where they need to grant you permissions to a (multi-)user/group picker custom field.
Let me know if that doesn’t work and I will try and replicate your case.
As you have mentioned in your initial post, the UserPicker isn’t loading because the /gateway/api/v1/recommendations API is erroring out.
I was trying to see if the version of the @forge/react package installed in the app contained a broken UserPicker component, but I’ve tested that version out and it’s been working fine for me.
My UserPicker works fine even without the Jira permission scopes in the manifest.yml file.
I have pinged the team that owns the /gateway/api/v1/recommendations API endpoint and asked them if there’s any reason why it would be failing for your friend’s site, but in the meantime, would you be able to confirm and provide the following information?
Is this problem still happening? I believe the API endpoint had some problems around the time this request was made, so wanted to make sure that it hasn’t already been fixed
Would you be able to provide a traceId and response body? this can be obtained by:
Opening up the web console and going to the Network tab
Go to the Jira page that contains the app with the broken UserPicker
Click into the UserPicker so that it tries to load users
Filter the network request by /gateway/api/v1/recommendations
Within the Response Headers tab there should be a X-Trace-Id property, send me this ID
Now go to the Response tab and send me the response
Please feel free to send all of this information through a PM if you’re uncomfortable sharing this in an open forum.
That’s consistent with what I’ve been seeing - when I make my own Forge app and install it on my site, through the Forge CLI, the UserPicker works fine. It’s when I install it on the different site through the installation URL that we see the errors.
The problem is indeed still happening. I just retested.
x-trace-id: e747f3feae774ee4afb5768b186372da
Response body:
{
"message": "The requesting user does not have permission to perform this action",
"status": "FORBIDDEN",
"statusCode": 403
}
Success! Thankyou! It turns out that somehow permissions on this instance got into a mess and nobody has the Browse users and groups permission. When I granted it I was able to view users in the UserPicker.
However, that revealed a second unexpected problem: this UserPicker shows only a single user at a time, not a list. I was able to find users by typing the first few characters of their names. I checked a UserPicker on a different site and that one showed a longer list.
Here’s a screenshot of the UserPicker showing only a single user:
Good to hear that it fixed the initial problem! Very interesting, I’ll check with the team that’s responsible for this. Wondering if you could check the network tab in developer console and see if there are any errors (following Camelia’s instructions a few replies above)?
Apologies for the delayed response as well, I was not able to replicate this issue on my setup. Can I confirm that this is still happening? Also wondering if this happens on a specific browser
I can still trigger it. The key is to have an admin take away the users & groups permission from your user.
It’s a niche issue, but realistically sometimes people are going to mess with the settings in ways that they shouldn’t, and may not even remember what they did. That’s what happened on the site where I encountered this.