Jira API list all projects using a workflow

Joel Batac August 21, 2022

I need help getting the list of projects using a specific workflow. Is there any API for this? If none, how do I go about achieving this?

1 answer

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 21, 2022

Not a direct one.  You will have to replicate broadly what an admin would have to do in the UI:

  • read the project list and work out what workflow scheme each one is using and what issue type scheme it has.
  • cross-reference which workflows are being attached to each issue type in the issue type scheme (just because a workflow is mapped in a scheme, doesn't mean the project actually uses it)

In the UI however, this is a doddle, it does it for you.  Go to Admin -> Workflows to see the list, and you'll see it tells you what projects are using the workflow.

I'd want to question why you think you need a list like this over an API though - what are you wanting the list for?

Joel Batac August 23, 2022

HI Nic,

 Thanks for the reply.  My goal is to have newly created project that are using the workflow added to behaviour mapping.

 I asked before how to automatically check the workflow used by a project and assign the proper behaviour. I was given an answer to use REST Endpoint  but it uses Basic authentication - our jira doesn't support this. After that I was given where you can hard code token; our token rotates/changes every hour. So that's not possible either. 

 My thinking is to get the current list of projects using the workflow via API/python and schedule it once a day  to get the current list of projects (save the list to a file) and check if there's a newly project added. If there is, run an API to add the new project to the behaviour mapping (this is another thing I am researching). 

 

 I hope i explained my self clearly :)

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 23, 2022

Changing the workflow setup of an existing project is not something you want to code for - it is a LOT of work, you'll need to do all the checks for change of status and step in the os workflow stuff, migrating the issues and you'll need to fail the process to ask the users if there are migrations needed.

Suggest an answer

Log in or Sign up to answer