Hi,
Is it possible to link and use OpsGenie with a custom services schema we create in Insight rather than the default read-only services schema it uses?
As we cannot add attributes to the service schema, we are looking to build a custom service schema where we can add the attributes we want and use them.
Thanks,
Aman
Hi @Aman yes I had a lot of trouble with that too. That's why I gave up putting the Affected Services field on screens, and instead putting the Service Object field. I recommend dropping the Affected Services field altogether from screens. The above automation will ensure the ITSM Change Management and Incident Management features will still work.
A further limitation I soon found is that the above automation doesn't support multiple values. Use this instead to support multiple Service Objects:
{"fields":{"Affected Services":[
{{#issue.Service Object.Service ID}}{{values.displayValue.asJsonObject("id")}}{{^last}},{{/}}{{/}}
]}}
Understanding why you can't just use {{issue.Service Object.Service ID.asJsonObjectArray("id")}} and have to write the smart value this way delves into how Insight Objects are structured in automation. Understanding that will help you with further automating your Insight Cloud database.
Regarding the following section:
You can't use JSON, text, or other smart value functions on Insight object attribute smart values because Insight object attribute smart values are quasi-objects that don't work like other smart values. You can preview this when you retrieve the attributes with appending "?expand=customfield_10378.cmdb.attributes" to the "rest/api/3/issue/ITSM-1" endpoint (referring here to the custom field ID in the example above, and example issue ITSM-1 in an ITSM service desk project with this field).
Automation does some shortcuts so you usually don't have to worry about the Insight object structure if you're doing simple updates on issues, but you seem the enterprising sort so you need to know this. Each level of an Insight object field is an array, ie. an Insight object custom field is an array of Insight objects containing an array of attribute objects containing an array of value objects. Here's the smart value structure for a Insight object custom field:
issue:
Some notes:
Hence the dance to update Affected Services with multiple Service Objects. eg. for updating from Product Objects, the JSON would be:
{"fields":{"Affected Services":[
{{#issue.Product Object.Service.Service ID}}{{values.displayValue.asJsonObject("id")}}{{^last}},{{/}}{{/}}
]}}
You can show all values for a Insight object custom field with this test rule:
{{#issue.Product Object}}{{label}} ({{objectType.name}}):
{{#attributes}}
- {{type.name}} ({{if(not(exists(type.defaultType.name)),type.type)}}{{type.defaultType.name}}): {{values.displayValue.join(", ")}}
{{/}}{{/}}
When you click "Run rule", it will report on all the attributes and their attribute type on the Product Object custom field as a comment.
So let's say you want to create an incident when a license is going to expire for a product. Let's add to the object schema above:
Insight Object type: Product
Automation rule: Daily expiring licenses report
The JSON for the Additional fields:
{
"fields": {
"Affected Services": [
{{#lookupObjects.Service.Service ID}}{{values.displayValue.asJsonObject("id")}}{{^last}},{{/}}{{/}}
]
}
}
This rule will create an incident, link to the objects with expiring licenses, link to the Affected Services, and then update those objects with a new Status.
Note that this is undocumented so Atlassian reserves the right to change the Insight smart value structures at any time without warning. Use this in production systems at your peril. You have been warned.
Kind of. A few times now, I have created a "Business Service" object type and a "When Object Created: Service" automation rule to copy these Services to Business Service objects. It's not possible though to copy across change approvers, or any changes to the service like change of name or tier, so I scrapped linking these Business Service objects.
I've since moved away from creating Business Service object types altogether. Instead of Affected Services field on forms, I offer a Service Object Insight field and then use the new Placeholders feature to direct users to choose from CIs. Here's some settings for a cloud site I'm working on at the moment:
Object Type: Product
I can then create service-specific object types which then link to the read-only Service schema objects, eg. "SharePoint Site", "Shared Mailbox", "Distribution List" object types.
Field: Affected Services
Field: Service Object
Field: Product Object
I then have an automation for setting Affected Services:
{"fields":{"customfield_10201":[{"id":"{{issue.Service Object.Service ID}}"}]}}
And when you add the Service Object and Product Object fields to a form (make sure the form is visible, Insight Object fields don't work on hidden request forms!), when a user chooses a Service Object, the Product Object field then shows all the relevant objects for the service.
This way, you still are linking your custom schema to OpsGenie, but even better, you're allowing the configuration of your services to be linked to OpsGenie.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your response. I went back and tried as per your suggestion. It kind of put us in the right direction, however I need some more help here. Here's the scenario:
Since the services schema is only a read only, we have created a custom schema (lets say schema A) that has services and their information, and is also linked to the original services schema through the attributes of its object types. We are trying to create an automation where whenever the value for "Affected service" (this field is by default linked with the services schema) is updated, another custom field (lets say Affected Business Services) that shows the services and added info from Schema A gets updated as they are linked so that all the information on a service is easily available and both the schemas are also updated.
However, we are having issues implementing this automation, and only worked when we tested the rule by hardcoding it for a particular service.
Let me know if there's any more information you need to help.
Thanks & Regards,
Aman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.