Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,300,161
Community Members
 
Community Events
165
Community Groups

Auto link Insight object to issue

Hi,

We would like to add all info of our customers deployment in Insight Asset Management.
Then, when the customer creates JSD ticket, show the CMDB info related to this customer in the issue to the support agent.
We would link both using the 'Organisations' field, using the organisation ID.
In the issue I have a automatically filled customfield, called 'Organization ID' which contains the ID of the organisation linked to the issue.

In the CMDB we have Customers with an attribute 'Org_ID' that contains the same info.

How now show the Customer Insight Object in the issue?

I tried creating an Insight Custom Field and set the Filter Assign Scope to "objectType = Customer AND Customer.Org_ID = ${customfield_22901.label}" but this is not working.

2 answers

I want the exact things, did you find the solution? 

Hi,
To make it work with the organization field, we used an automation that executes a scriptrunner script after the creation.
After testing and extra requirement to make it work in non service desk projects that do not have organizations, we switched to using another custom field that we have and that has the same values as the Organizations.
This field was already in use and was mainly set-up to be able to us customers in gadgets on dashboards (which is not possible with the organizations field).
This custom field is automatically filled using a Scriptrunner listener that runs after the creation of a ticket and can be manually adjusted if needed (fex when a reporter belongs to 2 organizations).
We than have the assign scope in the Insight Custom Field as follows: 
objectType = Customers AND Name = ${customfield_19801.name}

Hi Wim,

I have a similar situation in my instance I resolve this adding a script into the workflow in the creation transition. I my example I use the reporter username but you could use the customfield_22901 

 

def customField =  ComponentAccessor.getCustomFieldManager().getCustomFieldObject("customfield_22901");
 
def value = (String)issue.getCustomFieldValue(customField);

 

import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.fields.CustomField;
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.issue.MutableIssue;
import com.atlassian.jira.event.type.EventDispatchOption;

/* Insight custom field to set */
CustomField insightCF = ComponentAccessor.getCustomFieldManager().getCustomFieldObject(XXXX);

if (insightCF == null) {
return true;
}

/* Get Insight IQL Facade from plugin accessor */
Class iqlFacadeClass = ComponentAccessor.getPluginAccessor().getClassLoader().findClass("com.riadalabs.jira.plugins.insight.channel.external.api.facade.IQLFacade");
def iqlFacade = ComponentAccessor.getOSGiComponentInstanceOfType(iqlFacadeClass);

/* Specify the schema id as well as the IQL that will fetch objects. In this case all objects with Name matching the valueCF, be sure to include " around value */
def objects = iqlFacade.findObjectsByIQLAndSchema(X, "YOUR IQL)");

if (!objects.isEmpty()) {
MutableIssue mi = (MutableIssue) issue;
mi.setCustomFieldValue(insightCF, objects);
ComponentAccessor.getIssueManager().updateIssue(currentUser, mi, EventDispatchOption.DO_NOT_DISPATCH, false);
}
return true;

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Service Management

Coming Soon: Insight Changing to Assets

The 2020 acquisition of Mindville added powerful asset and configuration management capabilities to Jira Service Management in the form of Insight. Following the completion of that integration, custo...

489 views 3 13
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