Search code examples
javascripthttpjirajira-rest-apipython-jira

Get some user's team with Jira Rest API by their accountId


I'm using the JIRA rest API in order to get the team of some user by passing their accountId as a parameter in the URL, for example:

URL = "https://my_account.atlassian.net/rest/api/3/user?accountId="+userId+"/team"

But I'm getting the error: "404 item not found".

Does anyone have any idea how I could get what I need?

I'm developing with Google App.Script, but the programming language does not matter if someone has some useful idea. Thanks!


Solution

  • Firstly, you're forming the query incorrectly. You can't add parameters after the '?' using a forward slash because the forward slash is used for hierarchy in the URL.

    Secondly, there is no endpoint 'team' and there currently is no mechanism provided by the Jira REST API to lookup what Team a user is a member of. Refer to this thread on the Atlassian community.