Generate documents from Insight tables

Luca Andreatta
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.
April 27, 2021

Hi all,

we are using Jira Service Management with Insight, where we have put user's assets.

I'm looking for a way to generate some company standard documentation based on the data stored in Insight.

I found this plugin:

Is there some way to get data from Insight instead of Jira issues?

2 answers

1 accepted

1 vote
Answer accepted
Luca Andreatta
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.
May 7, 2021

I resolved using a scriptrunner postfunction that read data from Insight, perform some logic, replace this data in a template with placeholder using SimpleTemplateEngine class and then attach the resulting document to the issue.

The template is in HTML, in this way the assignee can open directly in the browser and print in pdf (with a pdf printer) if it is necessary.

Brandon Purnell November 30, 2021

I would love to hear more about how you replaced data in a template with data from Insight

Luca Andreatta
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.
December 1, 2021

Hi Brandon,

in the scriptrunner postfunction I used something like this:

 

def assetListMap = getAssetMapFromInsightList(insightAssetList, insightObjectSchemaId, adminUsername)

def binding = [

data: new Date().format('dd/MM/yyyy') ,

reporter: issue.reporter.displayName,

assetList: assetListMap

]

def engine = new SimpleTemplateEngine()

def template = engine.createTemplate(templateFile.text).make(binding)
And then I attached the template to the issue.
The binding object can be used in the templateFile and you can iterate in the objects and grab values from them.
For example:
<% for (asset in assetList) { %> 

<tr><td><%= asset.value1 %> <%= asset.value2 %></td></tr>

<% } %>
0 votes
Peter-Dave Sheehan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 27, 2021

It really depends on what you need and how your data is organized.

Insight has some built-in reporting features (though I haven't explored them much) and some REST APIs.

And if you know what you are doing or are adventurous, you could fetch data directly from the db (though that is not generally recommended).

Some of the bigger/expensive reporting solutions like eazyBI might already understand the Insight data and allow you to generate reports.
But most of the more simple/cheap/free ones like the one you linked probably will not.

Luca Andreatta
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.
April 28, 2021

Thank you, Peter, but I don't want to create a report from Insight tables.

What I want is to create a new word document, or pdf, using a template filled with data from Insight.

For example, I want to give a new employee a new pc, a monitor and a tablet. I need to create a new document with the assets associated with this new user in Insight, give it to him to sign it, and store it in our archive.

Peter-Dave Sheehan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 28, 2021

Just use the built-in label template builder

Create a template the size of a full page of paper and print that.

Suggest an answer

Log in or Sign up to answer