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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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,554,338
Community Members
 
Community Events
184
Community Groups

Get the property information of the insight type field in Issue by scriptrunner script

Hi all community members, looking forward to your assistance, thanks.

I expect to achieve the following by way of scriptrunner scripts
1、Get the attribute information value of the Account Full Name field value
2、Get the above attribute information values and then assign each of them to a field

Although I tried to write part of the content, but never succeeded.


import com.atlassian.jira.util.ComponentLocator
import com.riadalabs.jira.plugins.insight.channel.external.api.facade.IQLFacade
import com.onresolve.scriptrunner.runner.customisers.WithPlugin
import com.onresolve.scriptrunner.runner.customisers.PluginModule

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.ModifiedValue
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
import com.atlassian.jira.issue.Issue

import com.riadalabs.jira.plugins.insight.services.model.ObjectBean

import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField

Issue issue
@WithPlugin(value = "com.riadalabs.jira.plugins.insight")
@PluginModule IQLFacade iqlFacade

iqlFacade.findObjects("objectType = Сотрудник")

//定位issue,并获取issue中需要的字段信息
def Issue = Issues.getByKey('PCAP-51').getCustomFieldValue("Account Full Name")

//获取该字段内的属性信息

log.info("Get Technical Group from insight object")
Class objFacadeClass = ComponentAccessor.getPluginAccessor().getClassLoader().loadClass("com.riadalabs.jira.plugins.insight.channel.external.api.facade.ObjectFacade")
def rtObj = ComponentAccessor.getOSGiComponentInstanceOfType(objFacadeClass)
def cfManager = ComponentAccessor.getCustomFieldManager()

//final tgId = 937

def incidentAssetCf = ComponentAccessor.getCustomFieldManager().getCustomFieldObject(11400)
def incidentAssetValue = issue.getCustomFieldValue(incidentAssetCf)

def rtObjAttr = rtObj.loadObjectAttributeBean().getObjectAttributeValueBeans()

def tgVal = rtObjAttr.first().value

log.info("Technical Group value is: $tgVal")

 

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events