Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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

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!

This helps!!!

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

Cheers!

0 votes

@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.

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
Community showcase
Published in Jira Service Management

Atlympic Event: Jira Service Managemnt

Hello Community!  Quick disclaimer: We are running a contest on Community (The Atlympics!) from July 23rd - August 8th of 2021. If you are interested in participating in this contest (prizes! ...

215 views 1 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you