Forums

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

Interacting with Insight objects from Scriptrunner Server/Data-center

29 comments

PD Sheehan
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.
September 15, 2023

With the release and expansion of HAPI, this utility is probably not really needed (though I haven't made the switch myself yet).

But to answer @David Harkins In my testing just now, a single string group name or a collection of string group names both work (at least in my local implementation). 

It's been a little while since I refreshed the code in the repo. Maybe there is a bug in there that I fixed locally.

But from a data standpoint, Insight stores group attributes as string values.

Amos
Contributor
October 17, 2023

Can ScriptRunner access all the packages in https://docs.atlassian.com/assets/10.4.10/ for consumption related to assets/insights?

E.g. we want to run a cron job that automates the asset model export to the shared home (class ExportObjectSchemaDataBean) but it doesn't not appear that ScriptRunner can resolve accessing the class.

PD Sheehan
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.
October 17, 2023

There should be no issue accessing any of these packages.

But there might be some that are hidden/inaccessible.

For example, the class you mentioned is accessible (i.e. can be imported), but you can't construct it from scratch. There isn't a public service that will generate one of those object (that I'm aware of).

Just now I found this deprecated method: https://docs.atlassian.com/assets/10.4.10/com/riadalabs/jira/plugins/insight/channel/external/api/facade/ConfigureFacade.html#exportObjectSchemaConfiguration-int- and was able to generate a quick script to generate an xml definition. It seems to match the schema.xml file

import com.onresolve.scriptrunner.runner.customisers.PluginModule
import com.onresolve.scriptrunner.runner.customisers.WithPlugin
import com.riadalabs.jira.plugins.insight.channel.external.api.facade.ConfigureFacade
@WithPlugin('com.riadalabs.jira.plugins.insight')  insightPlugin
@PluginModule ConfigureFacade cgFacade
def xmlExport = cgFacade.exportObjectSchemaConfiguration(1)

But I'm not sure if there is a service that can generate the full .zip export (stored in <jira-home>export/insight

If there is, the name is not obvious.

Like Amos likes this
Amos
Contributor
October 17, 2023

Thanks @PD Sheehan , that worked for us and has put us on the right track! I'll work out how to use the new method if it's accessible. Cheers!

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events