Unlike the following thread: https://community.atlassian.com/t5/Marketplace-Apps-Integrations/Set-Insight-Automation-to-Concatenate-two-Attributes-when-an/qaq-p/1489152 when I'm trying to save my automation I have the following error :
Error
An error occurred when updating the rule. Please try again and report the problem if it continues.
My goal is to standardize by automation all the name of the object type "License (per user)" by concatening the two value : License and Username.
Environment
Jira Service Management 4.20.1 on premises
I'd appreciate any help, thanks in advance !
I finally resolved my issue, I created a new automation as follow :
and created the following Groovy script using ScriptRunner plugins:
import com.atlassian.jira.component.ComponentAccessor;
Class objectFacadeClass = ComponentAccessor.getPluginAccessor().getClassLoader().findClass("com.riadalabs.jira.plugins.insight.channel.external.api.facade.ObjectFacade");
Class objectTypeFacadeClass = ComponentAccessor.getPluginAccessor().getClassLoader().findClass("com.riadalabs.jira.plugins.insight.channel.external.api.facade.ObjectTypeFacade");
def objectTypeFacade = ComponentAccessor.getOSGiComponentInstanceOfType(objectTypeFacadeClass);
def objectFacade = ComponentAccessor.getOSGiComponentInstanceOfType(ComponentAccessor.getPluginAccessor().getClassLoader().findClass("com.riadalabs.jira.plugins.insight.channel.external.api.facade.ObjectFacade"));
def objectTypeAttributeFacade = ComponentAccessor.getOSGiComponentInstanceOfType(ComponentAccessor.getPluginAccessor().getClassLoader().findClass("com.riadalabs.jira.plugins.insight.channel.external.api.facade.ObjectTypeAttributeFacade"));
def objectAttributeBeanFactory = ComponentAccessor.getOSGiComponentInstanceOfType(ComponentAccessor.getPluginAccessor().getClassLoader().findClass("com.riadalabs.jira.plugins.insight.services.model.factory.ObjectAttributeBeanFactory"));
def objectTypeAttributeBean = objectTypeAttributeFacade.loadObjectTypeAttributeBean(1919).createMutable() //Get Name object based on ID attribute
//log.info(object.getObjectAttributeBeans().toString());
def attributes = object.getObjectAttributeBeans();
attributes.each{attribute ->
def type;
try {
type = objectTypeAttributeFacade.loadObjectTypeAttributeBean(attribute.getObjectTypeAttributeId());
} catch (Exception ee) {
log.warn("Could not load objectdue to validation exception:" + ee.getMessage());
}
if (type != null && "Software".equals(type.getName())){
license = objectFacade.loadObjectBean(attribute.getObjectAttributeValueBeans()[0].getValue().intValue()).getName();
}
if (type != null && "Username".equals(type.getName())){
username = attribute.getObjectAttributeValueBeans()[0].getValue();
}
}
def newname = username + ' - ' + license ;
/* Create the new attribute bean based on the value */
def newObjectAttributeBean = objectAttributeBeanFactory.createObjectAttributeBeanForObject(object, objectTypeAttributeBean, newname);
/* Load the attribute bean */
def objectAttributeBean = objectFacade.loadObjectAttributeBean(object.getId(), objectTypeAttributeBean.getId());
if (objectAttributeBean != null) {
/* If attribute exist reuse the old id for the new attribute */
newObjectAttributeBean.setId(objectAttributeBean.getId());
}
/* Store the object attribute into Insight. */
try {
objectTypeAttributeBean = objectFacade.storeObjectAttributeBean(newObjectAttributeBean);
} catch (Exception vie) {
log.warn("Could not update object attribute due to validation exception:" + vie.getMessage());
}
Hope it can help someone :).
Topic resolved on my end.
I tried opening the Developer tools to troubleshoot the issue
The last cookie have the following information : "The cookie was blocked because neither did the request URL's domain exactly match the cookie's domain, nor was the request URL's domain a subdomain of the cookie's Domain attribute value"
As I was in incognito mode to login as administrator, I tried to follow that link solution https://confluence.atlassian.com/jirakb/where-are-the-insight-logs-for-data-center-installations-1040617518.html
Unsuccessful so far.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Yannick,
I don't see any problem with the syntax, but I don't use Jira Server either. I do know that would probably work if you were using Automation for Jira (there's a free and paid add-on) as I do that with Jira Cloud.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would suggest creating your rule using automation for Jira instead of the built in JWM automation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I checked Automation and Project Automation, both of them do not offer option related to Insight, neither in condition nor action offered. I guess that's a feature only available for Jira Cloud ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Looks like that is the case. Are you using the Paid Automation Pro versioin?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah, looks like it is not possible. :-(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.