How do I get a list of the projects on a gateway?

def doGet(request, session):
	import operator
	from com.inductiveautomation.ignition.gateway import IgnitionGateway
	 
	results = []
	context = IgnitionGateway.get()
	
	for project in context.getProjectManager().projectNames:
		
		results.append({
			'name': project
		})
		
	results = sorted(results, key=operator.itemgetter('name'))
			
	return {
		'json': {
			'parameters': {}, 
			'totalResults': len(results), 
			'projects': results
		}
	}
1 Like

I know this is an old thread but posing because I had the same question and was struggling with some of the other solutions.

There is a system function that will return a list of project on a gateway.
https://docs.inductiveautomation.com/display/DOC81/system.project.getProjectNames

1 Like

I was curious, so I did a quick search and found this:

It looks like this was added in 2020, but looking at the posts on this thread between 2020 and now; most of them have strayed a bit from the original topic, so I guess it makes sense that they don't mention this.

Hi John,

Did you find an answer to this question?
I'm looking for the same information and was surprised that the info is not included in the getProjectInfo() function.