<img height="1" width="1" style="display:none;" alt="" src="https://px.ads.linkedin.com/collect/?pid=299788&amp;fmt=gif">

Just a little Botron Help...

Atlassian, Jira, Atlassian Add-Ons

atlassian-jira-configurations

If you are using the API for a full Jira system merge between instances, then you're really smart.

You have 500 projects to merge with another Jira instance in the organization.  Botron Software's Configuration Manager for Jira is the best tool for the job.  However, if you are moving all projects, it will not make sense to trigger multiple snapshots from the GUI in Jira.  It's just too difficult and time consuming to select 100s of multiple projects from a select list GUI form.  Luckily Botron provides an API endpoint for generating the snapshots, and for deploying the snapshots.

I was a little confused when reading the API documentation.  So, perhaps I can save someone else some time.

The following are not valid when combined with the scope of "project" or "projectWithIssues".  They only seem to apply with "system" scope.

"includeAllFilters" : true,
"includeAllBoards" : true,
"includeAllDashboards" : true

Depending on the system being migrated, projects may need to be split into multiple snapshots depending on how much data is involved.  Because of project interlinking and and other types of relationships, system snapshots may also be necessary.  This will be because dependent and interlinked projects will likely need to be created in order to move any given project.  As consultants tasked to merge foreign instances, we almost never know the history of the Jira instance well enough to know what projects are related.  So, you either deploy a full configuration only system snapshot ahead of the project with issues snapshots, or you have to generate lists of your filters, dashboards and Agile boards that need to be migrated with everything else.  When performing a merge, there is a lot going on...it is not a trivial process in the least.  The potential for things to go wrong increases with the number of snapshots you need to deploy.  So ideally, you would like to capture everything you need in a single snapshot.

The json payload for the creating snapshots has to be formatted correctly for it to work right.  The objects you want in the snapshot have to be identified by database ID.

Here are example queries to generate the lists of projects, filters, dashboards and agile boards.

-% mysql -B --disable-column-names --execute 'select distinct concat(""", pkey, """, ",") from project' jiratemp

Object: Agile boards

Query: select concat("{ \"boardId\" : ", id, " },") from AO_60DB71_RAPIDVIEW;

Example Output:

{ "boardId" : 11 },
{ "boardId" : 42 },
{ "boardId" : 48 },
{ "boardId" : 70 },

Object: Dashboards

Query: select concat("{ \"dashboardId\" : ", id, " },") from portalpage;

Example Output:

{ "dashboardId" : 10000 },
{ "dashboardId" : 10210 },
{ "dashboardId" : 10040 },
{ "dashboardId" : 10172 },

Object: Filters

Query:

Private Filters:
select concat("{ \"filterId\" : ", id, " },") from searchrequest where id not in \ (select entityid from sharepermissions where entitytype='SearchRequest');
Public Filters:
select concat("{ \"filterId\" : ", id, " },") from searchrequest where id in \ (select entityid from sharepermissions where entitytype='SearchRequest');
All Filters:
select concat("{ \"filterId\" : ", id, " },") from searchrequest;

Example Output:

{ "filterId" : 11597 },
{ "filterId" : 11671 },
{ "filterId" : 11767 },
{ "filterId" : 11860 },

Object: Projects

Query: select concat("\"", pkey, "\"", ",") from project;

Example Output:

"ABCD",
"OURS",
"THEIRS",
"IT",
"API"

Botron Snapshot JSON

Once you have all your lists, you can assemble json to include all projects and private objects.  This is a simple example, but it can get very long with more projects.

sample.json

{
"name" : "all-projects-with-issues",
"description" : "All projects with issues, agile boards, filters and dashboards",
"scope" : "projectWithIssues",
"projectKey" : [
"ABCD",
"OURS",
"THEIRS",
"IT",
"API"
],
"filters" : [
{ "filterId" : 11597 },
{ "filterId" : 11671 },
{ "filterId" : 11767 },
{ "filterId" : 11860 }
],
"agileBoards" : [
{ "boardId" : 11 },
{ "boardId" : 42 },
{ "boardId" : 48 },
{ "boardId" : 70 }
],
"dashboards" : [
{ "dashboardId" : 10000 },
{ "dashboardId" : 10210 },
{ "dashboardId" : 10040 },
{ "dashboardId" : 10172 }
],
"options" : {
"checkCustomFieldValues" : true,
"includeAttachmentFiles" : false
}
}

Execute the POST via curl

curl -u username:password -i -H "Content-Type: application/json" -X POST http://localhost:8080/rest/configuration-manager/api/1.3/snapshots -d @sample.json

Thats it! When it's complete, you can refresh the snapshots page and see the new snapshot, ready to be downloaded.

Managing JIRA at Scale White Paper

TAGS: Atlassian, Jira, Atlassian Add-Ons

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Subscribe to Our Newsletter

Recent Blog Posts