The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Set the Summary with a selected insight object name

Anna Protopapa
Contributor
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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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 Champions.
February 10, 2021

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

Anna Protopapa
Contributor
February 10, 2021

Yes, it behaviour (scriptrunner)

DEPLOYMENT TYPE
SERVER
VERSION
8.8.0
TAGS
AUG Leaders

Atlassian Community Events