Selecting multiple projects via REST API when creating snapshot

Currently CMJ provides a multi-selection dropdown to select several projects when creating a snapshot as part from the snapshot wizard.

Often this is not convenient for selecting large number of projects or when all projects are required to be part of the snapshot.

In this case, CMJ's REST API can be used to create the snapshot providing a list of project keys.

  • To learn more about CMJ's REST API refer to this page.
  • For more information about the documentation of the REST API refer to this page.

Following is an example that creates a snapshot for projects with keys PRJA and PRJB including filters, boards and dashboards.

curl -u admin:admin -i -H "Content-Type: application/json" -X POST http://localhost:2990/jira/rest/configuration-manager/api/1.3/snapshots -d '
	{
		"name" : "My Project Snapshot",
		"description" : "Interesting snapshot",
		"scope" : "project",
		"projectKey" : [
			"PRJA",
			"PRJB"
		],
		"filters" : [ {
			"filterId" : 10001
		} ],
		"agileBoards" : [ {
			"boardId" : 10001
		} ],
		"dashboards" : [ {
			"dashboardId" : 10001
		} ],
		"options" : {
			"checkCustomFieldValues" : true
		}
	}
	'