How to retrieve and display insight objects based on the value of a different object?

Aman July 11, 2021

Hello Community,

I have a "schema A" in Insight, where objects of a certain object type are linked to services from the "Services" schema. I want to display certain attributes of these objects from the schema A to the agent based on the value of the service selected under the "Affected Services" field (which is by default linked to the Services).

Can someone please tell me how to achieve this?

Thanks & Regards,

Aman

2 answers

1 accepted

1 vote
Answer accepted
Alex van Vucht (GLiNTECH)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 13, 2021

Hi @Aman I responded in your related question: https://community.atlassian.com/t5/Jira-Service-Management/Can-only-service-schema-be-linked-to-OpsGenie/qaq-p/1745402

I'll further add to the answer there:

I really don't like manipulating Insight objects based on the {{issue.affectedServices}} smart Value. You can't access the Service ID smart value properly.

eg. {{issue.affectedServices.serviceId}} returns:

b:YXJpOmNsb3VkOmdyYXBoOjpzZXJ2aWNlLzI3ZWY0OTk1L<snip>1LWYwYzk0ZmY1YmViNy9lODNkYjc4MC1kZTJiLTExZWItYmIzZi0wYWJlM2Y0YTY2MDE=

This is a Base64 encoded value for the actual service ID, which you can access from the Services schema with a Service Object insight custom field:

ari:cloud:graph::service/27ef4995-3488-4050-aba5-f9<snip>eb7/e83db780-de2b-11eb-bb3f-0a<snip>01

Automation doesn't support decoding Base64 values. So you can't look up objects in Insight Services schema based on the Service ID.

As a workaround, you can use {{issue.affectedServices.name}}. This will match a Service in the Services schema. So if you want to show information from a custom schema linking to an object, presuming your objects' Service attribute is called Service, you can use in a Lookup Object action:

Service IN ({{issue.affectedServices.name.asJsonString.join(",")}})

 

I actually used this recently in a Canned Response implementation in Insight.

Insight Object Type: Canned Response

  • Service: link to Service objects in Services schema
  • Operation: link to Operation objects (can be a drop down or text field instead, but I use these Operation objects elsewhere for categorising work)
  • Workflow Status: text field
  • Suggested Response: textarea field

I added the Operation Insight object custom field as a hidden field on request forms and then used this automation:

  1. When issue transitioned
  2. Lookup Objects:
    • IQL: objectType = "Canned Response" AND
      Service = {{issue.affectedServices.name.first.asJsonString.join(",")}} AND
      Operation = {{issue.Operation object}} AND
      Status = {{issue.status.name}}
  3. If: Advanced Compare: {{lookupObjects.size}} > 0
  4. Edit issue:
    • Suggested response: {{lookupObjects.Suggested response}}

Hope that helps, Insight Cloud with Jira Automation is really, really powerful!

Aman July 27, 2021

This helps!!!

Thanks @Alex van Vucht (GLiNTECH)  for your guidance on both my questions. It has indeed helped us a lot.

Cheers!

0 votes
Joseph Chung Yin
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 11, 2021

@Aman -

When you created custom field in Jira/JSM based on your Insight Schema object, you can display the attributes associated with your object using the "Configure Insight Custom Field" UI (NOTE - this is available when you setup your custom field for Jira/JSM)

2021-07-11_22-12-47.png

I am assuming that you have Jira/JSM administrators rights to access the JIR Administration UI > Issues > Custom Fields.

Hope this helps.

Best, Joseph Chung Yin

Jira/JSM Functional Lead, Global Infrastructure Applications Team

Viasat Inc.

Aman July 12, 2021

Hi @Joseph Chung Yin 

Thanks for your reply, unfortunately I believe you have misunderstood my issue.

I'll try to explain it in more detail for you.

Since the services schema is only a read only, we have created a custom schema (schema A) that has services and their information, and is also linked to the original services schema. 

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, the linked service in the Schema A is updated, so that we can have all the details regarding the service in the issue view. 

However, we are having issues implementing this automation, and only works when we hardcode it.

Let me know if there's any more information you need to help.

Thanks & Regards,

Aman

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events