Hi everyone! Today we want to share the way we imported services and service-related info.
When Atlassian announced Opsgenie’s Service and Mindville Insight integrations into JSM, it transformed how one of our clients manages 1000+ services. Before they stored the information about each service in the custom Business Service field. For additional information about the service, they created project properties that also had a sequence of 10+ interdependent properties. Now the general information about the service (name, description, owner, tier, change approver, etc.) is stored in Service, and all the other service-related information (vendors scheme, assignee, technology stack, etc.) is in Insight.
To help the client take full advantage of the new JSM features, we needed to import services and service-related information. If you do not have many services, you can import them manually both in JSM and Opsgenie. In our case, such a method would take at least a week. So as to automate the process and reduce the time for importing, we have found other ways we want to share with you.
To import services, we took as a basis the Create Service request in Opsgenie API. We created a simple script and following the algorithm imported services:
Create Team in Opsgenie and add teamId.
Add the list of services to ArrayList names.
Run
public class setServices { public static void main(String[] args) { String teamId; teamId = "12345678-1234-1234-1234-1234567890ab"; ArrayList<String> names = new ArrayList<>(List.of("Service1", "Service2", "Service3")); for (String name : names) { Unirest.setTimeouts(0, 0); try { HttpResponse<String> response = Unirest.post("https://api.opsgenie.com/v1/services/") .header("Authorization", "GenieKey 12345678-1111-2222-1111-123456789012") .header("Content-Type", "application/json") .body("{\n \"teamId\": \"" + teamId + "\",\n \"name\": \"" + name + "\"\n}") .asString(); System.out.println(response.getStatusText()); } catch (UnirestException e) { e.printStackTrace(); } } } }
Repeating these steps allowed us to import services within 2 hours.
This method has several cons that we consider insignificant:
All imported services get Tier 1 value in Tier, as Opsgenie does not have this parameter. If your services also have equal tiers, it will not be a problem.
You will need to set Change Approvers manually if you have this parameter.
The method is inadvisable if you have many teams but few services (up to 3 services for each team), as we create Team manually. It will be faster and easier for you to import services manually.
To import other service-related information into Insight Objects, we:
Created Object Schema and Object Type
Added all the necessary Attributes (Owner, Status, Description, Assignee, etc.), configured their types, following the Manage Attributes support article.
Set the number of attribute values (if necessary for your project, do that in the attribute settings: Configure – Cardinality – Set checkbox Unlimited or change Maximum).
When importing data into Insight, we also used Atlassian documentation but faced some problems and found the workarounds we want to share with you.
Use “||” (2 pipe characters) in Object values to divide multiple values, as Atlassian recommends. The default symbol for dividing is a “-” , but the information may not be imported if this symbol is already used somewhere in the object name or attributes.
Check the names and all Attributes for empty characters (spaces, line breaks, etc.), otherwise, later the search in Insight may work incorrectly.
Do not use “+” characters in Group and Object names, as Atlassian will work with errors, and Group or Object will not be created. Try to avoid such symbols “&”, “+”, “)”, “(“ too because of bugs. Add comments to these bugs (bug1, bug2) to increase their priority and probability of their fix.
Select “Create predefined configuration” instead of “Create a predefined structure”, as Object Schema and structure (Object Type) have been created manually.
Сreate an import configuration. Enter the predefined configuration “Name = ${Name of Column}” in Object mapping (IQL), if there are objects of other schemes among Object Attributes. Click on the name of the newly created import, and then on the selected Object Type.
Nevertheless, Services and Insight can facilitate service management since all information on objects can be stored in one place and be successfully imported. Feel free to roast us in the comments :)
Natalya Ozhigova
Atlassian Administrator
Itransition
Belarus
3 accepted answers
2 comments