Set the Summary with a selected insight object name

Anna Protopapa February 10, 2021

Hello,

We are trying to set the summary field with the name of a selected Insight object. 

Can anybody help us?

Thank you

Anna

import com.atlassian.jira.component.ComponentAccessor
import com.onresolve.scriptrunner.runner.customisers.PluginModule
import com.onresolve.scriptrunner.runner.customisers.WithPlugin
import com.riadalabs.jira.plugins.insight.channel.external.api.facade.ObjectFacade
import com.riadalabs.jira.plugins.insight.channel.external.api.facade.ObjectTypeAttributeFacade
import com.riadalabs.jira.plugins.insight.channel.external.api.facade.IQLFacade
import com.onresolve.scriptrunner.runner.customisers.WithPlugin

@WithPlugin("com.riadalabs.jira.plugins.insight")
@PluginModule IQLFacade iqlFacade

// if (getActionName() != "Create Issue") {
// return // not the initial action, so don't set default values
//}

// set Summary
def AffectedItemField = getFieldByName("Affected Item")
def AffectedItem = AffectedItemField.getFormValue()
def summary = getFieldById("summary")
def AffectedItemName = iqlFacade.findObjectsByIQLAndSchema(10, "key = ITSM-36608")
summary.setFormValue(AffectedItemName.Name)

1 answer

0 votes
Aiden Marriott
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.
February 10, 2021

I assume this is ScriptRunner?  Is it a "behaviour"?

Anna Protopapa February 10, 2021

Yes, it behaviour (scriptrunner)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.8.0
TAGS
AUG Leaders

Atlassian Community Events