I want to obtain a Team's ID in order to assign it to a work item or mention it in a comment via automation.
The Teams API only offers me to fetch all teams in a paginated list, but due to the limitations of Jira automations I cannot loop through it to find the matching entry. There is no endpoint that allows me to search for a team by it's name.
Is there any other way to get the ID? If not, is there any open bug report feature request I can vote on to get this feature in 2035?
Thanks for your suggestions 😊
After a quick look, it seems that the current REST API end-point can't search by name.
Here is a lame workaround that could eventually work:
I mean, the "all teams" endpoint will return a JSON array like this:
[ { "description": "<string>", "displayName": "<string>", "organizationId": "<string>", "teamId": "<string>", "teamType": "OPEN" } ] }
It seems possible to match a regex to the "displayName" field, and get the value of the very next "teamId" field.
Of course, if you have a lot of teams, so they are returned in multiple pages, things may get complicated.
Just an idea.
Thanks for the suggestion! I had thought about that, but as you mentioned - handling paginated output from the API in an automation rule isn't fun. Do you know of a way to properly loop through such output within automations? Or do I need an external tool that has 'real' deterministic loops?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't know what is the right approach with paginated results. (Maybe if it is possible to pass the page size and you pass the maximum allowed, you can save it. But I'm sure you tried this already...)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Jared Schmitt
I'd like to clarify if you're looking for the ID of the Team field or the ID of a specific team. Asking this because the article you've linked mentions using the team field's ID as well in the 'Create variable' action.
To get the field ID: Go to Settings > Work Items > Custom fields and search for the Team Field. Click on the 3 dots on the far right > View Field Information. The ID is present in the URL. (It is 10001 for the Team system field).
To get the ID of a specific team, select Teams from the top menu, search for the required team, and open its details. Its ID is available in the URL.
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
PS. I believe we don't have an endpoint to search with names because multiple teams can have same names, so it's not a unique identifier.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for the answer. I'm indeed looking for the ID of a specific team, not the cf. Looking up the ID via UI works, but not in an automation. I need a mechanism to look up the ID via API call etc. It would be OK to receive a list of matching teams & their IDs. The absence of such an endpoint makes it quite difficult to handle some use-cases.
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.